httprepo: make "http://user:pass@host/" urls work
authorVadim Gelfer <vadim.gelfer@gmail.com>
Fri, 16 Jun 2006 10:19:45 -0700
changeset 2447 cd00531ecc16
parent 2446 1b2bbb2b4911
child 2448 b77a2ef61b81
httprepo: make "http://user:pass@host/" urls work
mercurial/httprepo.py
--- a/mercurial/httprepo.py	Fri Jun 16 10:02:59 2006 -0700
+++ b/mercurial/httprepo.py	Fri Jun 16 10:19:45 2006 -0700
@@ -12,13 +12,13 @@
 demandload(globals(), "hg os urllib urllib2 urlparse zlib util httplib")
 demandload(globals(), "keepalive")
 
-class passwordmgr(urllib2.HTTPPasswordMgr):
+class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
     def __init__(self, ui):
-        urllib2.HTTPPasswordMgr.__init__(self)
+        urllib2.HTTPPasswordMgrWithDefaultRealm.__init__(self)
         self.ui = ui
 
     def find_user_password(self, realm, authuri):
-        authinfo = urllib2.HTTPPasswordMgr.find_user_password(
+        authinfo = urllib2.HTTPPasswordMgrWithDefaultRealm.find_user_password(
             self, realm, authuri)
         if authinfo != (None, None):
             return authinfo
@@ -133,7 +133,8 @@
 
         passmgr = passwordmgr(ui)
         if user:
-            ui.debug(_('will use user %s for http auth\n') % user)
+            ui.debug(_('will use user %s, password %s for http auth\n') %
+                     (user, '*' * len(passwd)))
             passmgr.add_password(None, host, user, passwd or '')
 
         opener = urllib2.build_opener(