convert: default to file protocol when no :// found for svn repo url
authorEdouard Gomez <ed.gomez@free.fr>
Sat, 06 Jun 2009 00:08:37 +0200
changeset 8764 46b5b4301fcc
parent 8763 fccdf5ca5065
child 8765 9c75f16f577c
convert: default to file protocol when no :// found for svn repo url Edited by pmezard: add path separator normalization
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Tue Jun 09 09:25:34 2009 -0400
+++ b/hgext/convert/subversion.py	Sat Jun 06 00:08:37 2009 +0200
@@ -161,10 +161,13 @@
             'file': filecheck,
             }
 def issvnurl(url):
-    if not '://' in url:
-        return False
-    proto, path = url.split('://', 1)
-    path = urllib.url2pathname(path).replace(os.sep, '/')
+    try:
+        proto, path = url.split('://', 1)
+        path = urllib.url2pathname(path)
+    except ValueError:
+        proto = 'file'
+        path = os.path.abspath(url)
+    path = path.replace(os.sep, '/')
     check = protomap.get(proto, lambda p, p2: False)
     while '/' in path:
         if check(path, proto):