url: use a regex to hide unsupported ssh passwords (
issue2754)
--- a/mercurial/url.py Sun Mar 27 13:34:20 2011 +0200
+++ b/mercurial/url.py Wed Apr 06 15:10:47 2011 -0500
@@ -25,6 +25,9 @@
def hidepassword(url):
'''hide user credential in a url string'''
+ if url.startswith("ssh://"):
+ # urllib doesn't know about ssh urls
+ return re.sub(r'(ssh://[^/]+):[^/]+(@.*)', r'\1:***\2', url)
scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
netloc = re.sub('([^:]*):([^@]*)@(.*)', r'\1:***@\3', netloc)
return _urlunparse(scheme, netloc, path, params, query, fragment, url)