Skip to content

Commit

Permalink
Merge pull request #12306 from pradyunsg/vcs-ref
Browse files Browse the repository at this point in the history
Use `-r=...` instead of `-r ...` for VCS CLI
  • Loading branch information
sbidoul authored Oct 1, 2023
2 parents 6d4b551 + 408b524 commit 1082eb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/12306.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use ``-r=...`` instead of ``-r ...`` to specify references with Mercurial.
2 changes: 1 addition & 1 deletion src/pip/_internal/vcs/mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Mercurial(VersionControl):

@staticmethod
def get_base_rev_args(rev: str) -> List[str]:
return ["-r", rev]
return [f"-r={rev}"]

def fetch_new(
self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_rev_options_repr() -> None:
# First check VCS-specific RevOptions behavior.
(Bazaar, [], ["-r", "123"], {}),
(Git, ["HEAD"], ["123"], {}),
(Mercurial, [], ["-r", "123"], {}),
(Mercurial, [], ["-r=123"], {}),
(Subversion, [], ["-r", "123"], {}),
# Test extra_args. For this, test using a single VersionControl class.
(
Expand Down

0 comments on commit 1082eb1

Please sign in to comment.