diff --git a/docs/html/reference/pip_install.rst b/docs/html/reference/pip_install.rst
index 9fcf94676..ca3ffb51e 100644
--- a/docs/html/reference/pip_install.rst
+++ b/docs/html/reference/pip_install.rst
@@ -417,8 +417,8 @@ making fewer network calls).
Mercurial
~~~~~~~~~
-The supported schemes are: ``hg+http``, ``hg+https``,
-``hg+static-http``, ``hg+ssh`` and ``hg+file``.
+The supported schemes are: ``hg+file``, ``hg+http``, ``hg+https``,
+``hg+static-http``, and ``hg+ssh``.
Here are the supported forms::
diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py
index e9906632d..a4d007c76 100644
--- a/src/pip/_internal/vcs/mercurial.py
+++ b/src/pip/_internal/vcs/mercurial.py
@@ -23,7 +23,7 @@ class Mercurial(VersionControl):
dirname = '.hg'
repo_name = 'clone'
schemes = (
- 'hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http', 'hg+file'
+ 'hg', 'hg+file', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http',
)
@staticmethod
diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py
index 59511bcdd..7f5f8cfdc 100644
--- a/tests/functional/test_install.py
+++ b/tests/functional/test_install.py
@@ -336,10 +336,11 @@ def test_install_editable_uninstalls_existing_from_path(script, data):
def test_basic_install_editable_from_hg(script, tmpdir):
"""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'])
- assert path_to_url(pkg_path).startswith("file://")
@need_mercurial