changeset 13823:ad179644750f

hg: look up schemes using url.url
author Brodie Rao <brodie@bitheap.org>
date Wed, 30 Mar 2011 20:02:07 -0700
parents fbf32a6c903e
children ec1695350361
files mercurial/hg.py tests/test-pull.t
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Mar 30 20:01:47 2011 -0700
+++ b/mercurial/hg.py	Wed Mar 30 20:02:07 2011 -0700
@@ -69,11 +69,8 @@
 }
 
 def _lookup(path):
-    scheme = 'file'
-    if path:
-        c = path.find(':')
-        if c > 0:
-            scheme = path[:c]
+    u = url.url(path)
+    scheme = u.scheme or 'file'
     thing = schemes.get(scheme) or schemes['file']
     try:
         return thing(path)
--- a/tests/test-pull.t	Wed Mar 30 20:01:47 2011 -0700
+++ b/tests/test-pull.t	Wed Mar 30 20:02:07 2011 -0700
@@ -68,7 +68,7 @@
 Test 'file:' uri handling:
 
   $ hg pull -q file://../test-doesnt-exist
-  abort: repository /test-doesnt-exist not found!
+  abort: file:// URLs can only refer to localhost
   [255]
 
   $ hg pull -q file:../test