changeset 14915:28edd65000d9 stable

url: handle urls of the form file:///c:/foo/bar/ correctly
author Matt Mackall <mpm@selenic.com>
date Fri, 22 Jul 2011 17:11:35 -0500
parents 41c3a71c318d
children 58f97dcbd550
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Thu Jul 21 16:02:34 2011 -0400
+++ b/mercurial/util.py	Fri Jul 22 17:11:35 2011 -0500
@@ -1353,6 +1353,8 @@
     <url scheme: 'ssh', host: '[::1]', port: '2200', path: '/home/joe/repo'>
     >>> url('file:///home/joe/repo')
     <url scheme: 'file', path: '/home/joe/repo'>
+    >>> url('file:///c:/temp/foo/')
+    <url scheme: 'file', path: 'c:/temp/foo/'>
     >>> url('bundle:foo')
     <url scheme: 'bundle', path: 'foo'>
     >>> url('bundle://../foo')
@@ -1442,7 +1444,7 @@
                     path = None
                 if not self.host:
                     self.host = None
-                    if path:
+                    if path and not hasdriveletter(path):
                         path = '/' + path
 
             if self.host and '@' in self.host: