Merge pull request #7065 from chrahunt/pr-5955

Explicit support for hg+file
This commit is contained in:
Christopher Hunt 2019-10-06 09:39:42 -04:00 committed by GitHub
commit 5a997b7509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

View File

@ -417,8 +417,8 @@ making fewer network calls).
Mercurial
~~~~~~~~~
The supported schemes are: ``hg+http``, ``hg+https``,
``hg+static-http`` and ``hg+ssh``.
The supported schemes are: ``hg+file``, ``hg+http``, ``hg+https``,
``hg+static-http``, and ``hg+ssh``.
Here are the supported forms::

1
news/4358.bugfix Normal file
View File

@ -0,0 +1 @@
Correct inconsistency related to the `hg+file` scheme.

View File

@ -27,7 +27,9 @@ class Mercurial(VersionControl):
name = 'hg'
dirname = '.hg'
repo_name = 'clone'
schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http')
schemes = (
'hg', 'hg+file', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http',
)
@staticmethod
def get_base_rev_args(rev):

View File

@ -334,9 +334,11 @@ def test_install_editable_uninstalls_existing_from_path(script, data):
@need_mercurial
def test_basic_install_editable_from_hg(script, tmpdir):
"""Test cloning from Mercurial."""
"""Test cloning and hg+file install from Mercurial."""
pkg_path = _create_test_package(script, name='testpackage', vcs='hg')
args = ['install', '-e', 'hg+%s#egg=testpackage' % path_to_url(pkg_path)]
url = 'hg+{}#egg=testpackage'.format(path_to_url(pkg_path))
assert url.startswith('hg+file')
args = ['install', '-e', url]
result = script.pip(*args)
result.assert_installed('testpackage', with_files=['.hg'])

View File

@ -131,6 +131,7 @@ class TestLink:
@pytest.mark.parametrize('url, expected', [
('git+https://github.com/org/repo', True),
('bzr+http://bzr.myproject.org/MyProject/trunk/#egg=MyProject', True),
('hg+file://hg.company.com/repo', True),
('https://example.com/some.whl', False),
('file://home/foo/some.whl', False),
])