# HG changeset patch # User Alexis S. L. Carvalho # Date 2007-11-09 22:21:35 # Node ID d5b9c74c910e4eab3033f10baffb0ab8dc91034c # Parent dcbda0c4c3eb8e26e01343d44fc5a8fb41138073 httprepo: give self._url and the netloc to the password manager This should hide some differences between different python versions. diff --git a/mercurial/httprepo.py b/mercurial/httprepo.py --- a/mercurial/httprepo.py +++ b/mercurial/httprepo.py @@ -256,7 +256,11 @@ class httprepository(remoterepository): if user: ui.debug(_('http auth: user %s, password %s\n') % (user, passwd and '*' * len(passwd) or 'not set')) - passmgr.add_password(None, host, user, passwd or '') + netloc = host + if port: + netloc += ':' + port + # Python < 2.4.3 uses only the netloc to search for a password + passmgr.add_password(None, (self._url, netloc), user, passwd or '') handlers.extend((urllib2.HTTPBasicAuthHandler(passmgr), httpdigestauthhandler(passmgr)))