Skip to content

Commit 35d59f1

Browse files
committed
vcs: Improve mercurial parameters handling
Make sure that all user provided input is handled as expected.
1 parent d83672a commit 35d59f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

weblate/vcs/mercurial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def check_config(self):
7070
@classmethod
7171
def _clone(cls, source: str, target: str, branch: str):
7272
"""Clone repository."""
73-
cls._popen(["clone", "--branch", branch, source, target])
73+
cls._popen(["clone", f"--branch={branch}", "--", source, target])
7474

7575
def get_config(self, path):
7676
"""Read entry from configuration."""
@@ -323,7 +323,7 @@ def on_branch(self, branch):
323323
def configure_branch(self, branch):
324324
"""Configure repository branch."""
325325
if not self.on_branch(branch):
326-
self.execute(["update", branch])
326+
self.execute(["update", "--", branch])
327327
self.branch = branch
328328

329329
def describe(self):
@@ -343,7 +343,7 @@ def describe(self):
343343
def push(self, branch):
344344
"""Push given branch to remote repository."""
345345
try:
346-
self.execute(["push", "-b", self.branch])
346+
self.execute(["push", f"--branch={self.branch}"])
347347
except RepositoryException as error:
348348
if error.retcode == 1:
349349
# No changes found
@@ -363,7 +363,7 @@ def cleanup(self):
363363

364364
def update_remote(self):
365365
"""Update remote repository."""
366-
self.execute(["pull", "--branch", self.branch])
366+
self.execute(["pull", f"--branch={self.branch}"])
367367
self.clean_revision_cache()
368368

369369
def parse_changed_files(self, lines: List[str]) -> Iterator[str]:

0 commit comments

Comments
 (0)