Fix issue 1782 don't do url2pathname conversion for urls
authorGrauw <laurens.hg@grauw.nl>
Fri, 07 Aug 2009 01:15:16 +0200
changeset 9521 e3ce0c30798b
parent 9520 bcc27ee3a37b
child 9523 d932dc655881
child 9524 effa05849027
Fix issue 1782 don't do url2pathname conversion for urls And only replace os-dependent path separators when necessary
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Tue Sep 29 23:49:42 2009 -0500
+++ b/hgext/convert/subversion.py	Fri Aug 07 01:15:16 2009 +0200
@@ -153,11 +153,13 @@
 def issvnurl(url):
     try:
         proto, path = url.split('://', 1)
-        path = urllib.url2pathname(path)
+        if proto == 'file':
+            path = urllib.url2pathname(path)
     except ValueError:
         proto = 'file'
         path = os.path.abspath(url)
-    path = path.replace(os.sep, '/')
+    if proto == 'file':
+        path = path.replace(os.sep, '/')
     check = protomap.get(proto, lambda p, p2: False)
     while '/' in path:
         if check(path, proto):