Mercurial > hg-stable
diff hgext/convert/subversion.py @ 17052:1bd18c415eec
convert: accept Subversion 'file:///c%3A/svnrepo' syntax on Windows
Subversion can handle ':' quoted as '%3A' but urllib.url2pathname can't and
Mercurial thus rejected some valid subversions URLs.
This particular case will now be handled by some preprocessing before handing
it over to urllib.url2pathname.
This is tested by 0413f68da85c when test-convert-svn-source.t and
test-convert-svn-move.t can be run on Windows.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 28 Jun 2012 03:41:37 +0200 |
parents | f17b561cc473 |
children | 0e4171fdb9d4 |
line wrap: on
line diff
--- a/hgext/convert/subversion.py Mon Jun 25 19:26:29 2012 +0200 +++ b/hgext/convert/subversion.py Thu Jun 28 03:41:37 2012 +0200 @@ -189,6 +189,9 @@ try: proto, path = url.split('://', 1) if proto == 'file': + if (os.name == 'nt' and path[:1] == '/' and path[1:2].isalpha() + and path[2:6].lower() == '%3a/'): + path = path[:2] + ':/' + path[6:] path = urllib.url2pathname(path) except ValueError: proto = 'file'