From 1e56f607be0e5dce0095ad730946d146b02b6e14 Mon Sep 17 00:00:00 2001 From: Efflam Lemaillet Date: Wed, 25 Oct 2023 15:10:21 +0200 Subject: [PATCH 1/2] fix mercurial revision parse error: use two hypen argument --rev= instead of -r= --- news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst | 1 + src/pip/_internal/vcs/mercurial.py | 2 +- tests/unit/test_vcs.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst diff --git a/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst b/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst new file mode 100644 index 00000000000..96ef4c66fda --- /dev/null +++ b/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst @@ -0,0 +1 @@ +fix mercurial revision parse error: use two hypen argument --rev= instead of -r= diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py index e440c122169..c183d41d09c 100644 --- a/src/pip/_internal/vcs/mercurial.py +++ b/src/pip/_internal/vcs/mercurial.py @@ -31,7 +31,7 @@ class Mercurial(VersionControl): @staticmethod def get_base_rev_args(rev: str) -> List[str]: - return [f"-r={rev}"] + return [f"--rev={rev}"] def fetch_new( self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int diff --git a/tests/unit/test_vcs.py b/tests/unit/test_vcs.py index 4a3750f2d36..5291f129cf7 100644 --- a/tests/unit/test_vcs.py +++ b/tests/unit/test_vcs.py @@ -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, [], ["--rev=123"], {}), (Subversion, [], ["-r", "123"], {}), # Test extra_args. For this, test using a single VersionControl class. ( From e7f14e78e211caae2f0173152340e422d4ea4edc Mon Sep 17 00:00:00 2001 From: efflamlemaillet <6533295+efflamlemaillet@users.noreply.github.com> Date: Thu, 26 Oct 2023 21:44:41 +0200 Subject: [PATCH 2/2] Update news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst Co-authored-by: Pradyun Gedam --- news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst b/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst index 96ef4c66fda..76a8e6b96db 100644 --- a/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst +++ b/news/370392cf-52cd-402c-b402-06d2ff398f89.bugfix.rst @@ -1 +1 @@ -fix mercurial revision parse error: use two hypen argument --rev= instead of -r= +Fix mercurial revision "parse error": use ``--rev={ref}`` instead of ``-r={ref}``