comparison mercurial/url.py @ 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 95265afff99f
children 6f61c480f51c
comparison
equal deleted inserted replaced
10483:c315125d0a39 10484:cadd7e076b69
49 if port: 49 if port:
50 hostport = host + ':' + port 50 hostport = host + ':' + port
51 else: 51 else:
52 hostport = host 52 hostport = host
53 if user: 53 if user:
54 quote = lambda s: urllib.quote(s, safe='')
54 if passwd: 55 if passwd:
55 userpass = urllib.quote(user) + ':' + urllib.quote(passwd) 56 userpass = quote(user) + ':' + quote(passwd)
56 else: 57 else:
57 userpass = urllib.quote(user) 58 userpass = quote(user)
58 return userpass + '@' + hostport 59 return userpass + '@' + hostport
59 return hostport 60 return hostport
60 61
61 _safe = ('abcdefghijklmnopqrstuvwxyz' 62 _safe = ('abcdefghijklmnopqrstuvwxyz'
62 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 63 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'