convert: default to file protocol when no :// found for svn repo url
Edited by pmezard: add path separator normalization
--- 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):