Skip to content

Commit

Permalink
vcs: Improve mercurial parameters handling
Browse files Browse the repository at this point in the history
Make sure that all user provided input is handled as expected.
  • Loading branch information
nijel committed Mar 3, 2022
1 parent 9a5a097 commit 0031613
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weblate/vcs/mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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]:
Expand Down

0 comments on commit 0031613

Please # to comment.