changeset 2447:cd00531ecc16

httprepo: make "http://user:pass@host/" urls work
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 16 Jun 2006 10:19:45 -0700
parents 1b2bbb2b4911
children b77a2ef61b81
files mercurial/httprepo.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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(