Mercurial > hg
diff hgext/convert/subversion.py @ 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 | 68e0a55eee6e |
children | c5f36402daad |
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):