# HG changeset patch # User Mads Kiilerich # Date 2012-06-28 01:41:37 # Node ID 1bd18c415eec578b5a8cc3bb61c65e554f4674e1 # Parent c5ed575f313788acd04614e3e0c13a5cdf5d7b39 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. diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -189,6 +189,9 @@ def issvnurl(ui, url): 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'