diff --git a/weblate/vcs/mercurial.py b/weblate/vcs/mercurial.py index 0399c1b0bae2..1131c1abd1e5 100644 --- a/weblate/vcs/mercurial.py +++ b/weblate/vcs/mercurial.py @@ -70,7 +70,7 @@ def check_config(self): @classmethod def _clone(cls, source: str, target: str, branch: str): """Clone repository.""" - cls._popen(["clone", "--branch", branch, source, target]) + cls._popen(["clone", f"--branch={branch}", "--", source, target]) def get_config(self, path): """Read entry from configuration.""" @@ -323,7 +323,7 @@ def on_branch(self, branch): def configure_branch(self, branch): """Configure repository branch.""" if not self.on_branch(branch): - self.execute(["update", branch]) + self.execute(["update", "--", branch]) self.branch = branch def describe(self): @@ -343,7 +343,7 @@ def describe(self): def push(self, branch): """Push given branch to remote repository.""" try: - self.execute(["push", "-b", self.branch]) + self.execute(["push", f"--branch={self.branch}"]) except RepositoryException as error: if error.retcode == 1: # No changes found @@ -363,7 +363,7 @@ def cleanup(self): def update_remote(self): """Update remote repository.""" - self.execute(["pull", "--branch", self.branch]) + self.execute(["pull", f"--branch={self.branch}"]) self.clean_revision_cache() def parse_changed_files(self, lines: List[str]) -> Iterator[str]: