mercurial/url.py
branchstable
changeset 13900 a3403d5b0af3
parent 13544 66d65bccbf06
child 13902 fab10e7cacd6
--- 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)