[PATCH] convert: default to file protocol when no :// found for svn repo url
Edouard Gomez
ed.gomez at free.fr
Fri Jun 5 17:36:19 CDT 2009
# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1244239717 -7200
# Node ID 6dcc7133c81d5fb86a555b0f6636559857ab1204
# Parent b5e9ed63913b2d953eb7f6fd704b5e356fa53642
convert: default to file protocol when no :// found for svn repo url
diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -161,10 +161,12 @@
'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).replace(os.sep, '/')
+ except ValueError:
+ proto = 'file'
+ path = os.path.abspath(url)
check = protomap.get(proto, lambda p, p2: False)
while '/' in path:
if check(path, proto):
More information about the Mercurial-devel
mailing list