Explicit support and tests for `hg+file` scheme for `pip install`.

This commit is contained in:
Adam Tse 2018-10-28 11:44:03 +00:00 committed by Chris Hunt
parent dd62731107
commit 3f98ee4250
4 changed files with 9 additions and 3 deletions

View File

@ -418,7 +418,7 @@ Mercurial
~~~~~~~~~
The supported schemes are: ``hg+http``, ``hg+https``,
``hg+static-http`` and ``hg+ssh``.
``hg+static-http``, ``hg+ssh`` and ``hg+file``.
Here are the supported forms::

2
news/4358.bugfix Normal file
View File

@ -0,0 +1,2 @@
Not a feature because the ``hg+file`` scheme was already functioning implicitly but inconsistently documented.
This change is to make the scheme support explicit, including tests and docs.

View File

@ -22,7 +22,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+http', 'hg+https', 'hg+ssh', 'hg+static-http', 'hg+file'
)
@staticmethod
def get_base_rev_args(rev):

View File

@ -334,11 +334,13 @@ 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)]
result = script.pip(*args)
result.assert_installed('testpackage', with_files=['.hg'])
assert path_to_url(pkg_path).startswith("file://")
@need_mercurial