changeset 8764:46b5b4301fcc

convert: default to file protocol when no :// found for svn repo url Edited by pmezard: add path separator normalization
author Edouard Gomez <ed.gomez@free.fr>
date Sat, 06 Jun 2009 00:08:37 +0200
parents fccdf5ca5065
children 9c75f16f577c
files hgext/convert/subversion.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):