mercurial/url.py
changeset 7285 5ad99abfab79
parent 7284 ac81ffac0f35
child 8150 bbc24c0753a0
--- a/mercurial/url.py	Tue Oct 28 22:24:41 2008 +0100
+++ b/mercurial/url.py	Tue Oct 28 23:54:01 2008 +0100
@@ -298,8 +298,13 @@
     opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
     return opener
 
+scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
+
 def open(ui, url, data=None):
-    scheme = urlparse.urlsplit(url)[0]
+    scheme = None
+    m = scheme_re.search(url)
+    if m:
+        scheme = m.group(1).lower()
     if not scheme:
         path = util.normpath(os.path.abspath(url))
         url = 'file://' + urllib.pathname2url(path)