diff tests/test-url.py @ 15609:8f4bad72d8b1 stable

util: fix url.__str__() for windows file URLs Before: >>> str(url('file:///c:/tmp/foo/bar')) 'file:c%3C/tmp/foo/bar' After: >>> str(url('file:///c:/tmp/foo/bar')) 'file:///c%3C/tmp/foo/bar' The previous behaviour had no effect on mercurial itself (clone command for instance) because we fortunately called .localpath() on the parsed URL. hgsubversion was not so lucky and cloning a local subversion repository on Windows no longer worked on the default branch (it works on stable because de7e2fba4326 defeats the hasdriveletter() test in url class). I do not know if the %3C is correct or not but svn accepts file:// URLs containing it. Mads fixed it in de7e2fba4326, so we can always backport should the need arise.
author Patrick Mezard <pmezard@gmail.com>
date Sun, 04 Dec 2011 18:22:25 +0100
parents 396e83d635a6
children ec8a49c46d7e
line wrap: on
line diff
--- a/tests/test-url.py	Fri Dec 02 21:38:57 2011 -0200
+++ b/tests/test-url.py	Sun Dec 04 18:22:25 2011 +0100
@@ -219,7 +219,7 @@
     >>> u
     <url scheme: 'file', path: 'f:oo/bar/baz'>
     >>> str(u)
-    'file:f%3Aoo/bar/baz'
+    'file:///f%3Aoo/bar/baz'
     >>> u.localpath()
     'f:oo/bar/baz'