Skip to content

Commit 26d2418

Browse files
efflamlemailletEfflam Lemailletpradyunsg
authored andcommitted
Fix hg: "parse error at 0: not a prefix:" (pypa#12373)
Use two hypen argument `--rev=` instead of `-r=` Co-authored-by: Efflam Lemaillet <[email protected]> Co-authored-by: Pradyun Gedam <[email protected]>
1 parent 4e8b0e4 commit 26d2418

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix mercurial revision "parse error": use ``--rev={ref}`` instead of ``-r={ref}``

src/pip/_internal/vcs/mercurial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Mercurial(VersionControl):
3131

3232
@staticmethod
3333
def get_base_rev_args(rev: str) -> List[str]:
34-
return [f"-r={rev}"]
34+
return [f"--rev={rev}"]
3535

3636
def fetch_new(
3737
self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int

tests/unit/test_vcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_rev_options_repr() -> None:
6666
# First check VCS-specific RevOptions behavior.
6767
(Bazaar, [], ["-r", "123"], {}),
6868
(Git, ["HEAD"], ["123"], {}),
69-
(Mercurial, [], ["-r=123"], {}),
69+
(Mercurial, [], ["--rev=123"], {}),
7070
(Subversion, [], ["-r", "123"], {}),
7171
# Test extra_args. For this, test using a single VersionControl class.
7272
(

0 commit comments

Comments
 (0)