mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #12119 from sbidoul/hg-explicit-rev-sbi
Pass revisions options explicitly to mercurial commands
This commit is contained in:
commit
4145168d68
3
news/12119.bugfix.rst
Normal file
3
news/12119.bugfix.rst
Normal file
|
@ -0,0 +1,3 @@
|
|||
Pass the ``-r`` flag to mercurial to be explicit that a revision is passed and protect
|
||||
against ``hg`` options injection as part of VCS URLs. Users that do not have control on
|
||||
VCS URLs passed to pip are advised to upgrade.
|
|
@ -31,7 +31,7 @@ class Mercurial(VersionControl):
|
|||
|
||||
@staticmethod
|
||||
def get_base_rev_args(rev: str) -> List[str]:
|
||||
return [rev]
|
||||
return ["-r", rev]
|
||||
|
||||
def fetch_new(
|
||||
self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int
|
||||
|
|
|
@ -66,7 +66,7 @@ def test_rev_options_repr() -> None:
|
|||
# First check VCS-specific RevOptions behavior.
|
||||
(Bazaar, [], ["-r", "123"], {}),
|
||||
(Git, ["HEAD"], ["123"], {}),
|
||||
(Mercurial, [], ["123"], {}),
|
||||
(Mercurial, [], ["-r", "123"], {}),
|
||||
(Subversion, [], ["-r", "123"], {}),
|
||||
# Test extra_args. For this, test using a single VersionControl class.
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue