mercurial/httprepo.py
changeset 2740 386f04d6ecb3
parent 2673 109a22f5434a
child 2858 345bac2bc4ec
--- a/mercurial/httprepo.py
+++ b/mercurial/httprepo.py
@@ -339,3 +339,13 @@ class httpsrepository(httprepository):
             raise util.Abort(_('Python support for SSL and HTTPS '
                                'is not installed'))
         httprepository.__init__(self, ui, path)
+
+def instance(ui, path, create):
+    if create:
+        raise util.Abort(_('cannot create new http repository'))
+    if path.startswith('hg:'):
+        ui.warn(_("hg:// syntax is deprecated, please use http:// instead\n"))
+        path = 'http:' + path[3:]
+    if path.startswith('https:'):
+        return httpsrepository(ui, path)
+    return httprepository(ui, path)