http: backout 181108726ea5, which breaks on Python 2.4
authorAugie Fackler <raf@durin42.com>
Sat, 14 Dec 2013 12:48:12 -0500
changeset 20174 af02783dea65
parent 20173 40f79b9a2cc8
child 20175 5ff0fd023850
http: backout 181108726ea5, which breaks on Python 2.4
mercurial/url.py
--- a/mercurial/url.py	Sat Dec 14 11:58:26 2013 -0500
+++ b/mercurial/url.py	Sat Dec 14 12:48:12 2013 -0500
@@ -8,7 +8,6 @@
 # GNU General Public License version 2 or any later version.
 
 import urllib, urllib2, httplib, os, socket, cStringIO
-import base64
 from i18n import _
 import keepalive, util, sslutil
 import httpconnection as httpconnectionmod
@@ -419,22 +418,9 @@
 
 class httpbasicauthhandler(urllib2.HTTPBasicAuthHandler):
     def __init__(self, *args, **kwargs):
-        self.auth = None
         urllib2.HTTPBasicAuthHandler.__init__(self, *args, **kwargs)
         self.retried_req = None
 
-    def http_request(self, request):
-        if self.auth:
-            request.add_unredirected_header(self.auth_header, self.auth)
-
-        return request
-
-    def https_request(self, request):
-        if self.auth:
-            request.add_unredirected_header(self.auth_header, self.auth)
-
-        return request
-
     def reset_retry_count(self):
         # Python 2.6.5 will call this on 401 or 407 errors and thus loop
         # forever. We disable reset_retry_count completely and reset in
@@ -449,19 +435,6 @@
         return urllib2.HTTPBasicAuthHandler.http_error_auth_reqed(
                         self, auth_header, host, req, headers)
 
-    def retry_http_basic_auth(self, host, req, realm):
-        user, pw = self.passwd.find_user_password(realm, host)
-        if pw is not None:
-            raw = "%s:%s" % (user, pw)
-            auth = 'Basic %s' % base64.b64encode(raw).strip()
-            if req.headers.get(self.auth_header, None) == auth:
-                return None
-            self.auth = auth
-            req.add_unredirected_header(self.auth_header, auth)
-            return self.parent.open(req, timeout=req.timeout)
-        else:
-            return None
-
 handlerfuncs = []
 
 def opener(ui, authinfo=None):