changeset 10484:cadd7e076b69 stable

url: correctly quote '/' in user and password embedded in urls
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 15 Feb 2010 22:39:36 +0100
parents c315125d0a39
children 677fee0a0604
files mercurial/url.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Mon Feb 15 16:34:59 2010 -0200
+++ b/mercurial/url.py	Mon Feb 15 22:39:36 2010 +0100
@@ -51,10 +51,11 @@
     else:
         hostport = host
     if user:
+        quote = lambda s: urllib.quote(s, safe='')
         if passwd:
-            userpass = urllib.quote(user) + ':' + urllib.quote(passwd)
+            userpass = quote(user) + ':' + quote(passwd)
         else:
-            userpass = urllib.quote(user)
+            userpass = quote(user)
         return userpass + '@' + hostport
     return hostport