Catch first succesful authentification to avoid further 401 roudtrips in hhtp urllib implementation.
* bzrlib/transport/http/_urllib2_wrappers.py: (Request.__init__): Initialize auth parameters. (Request.extract_auth): Moved to HttpTransport_urllib._extract_auth. (Request.set_auth): New method. (PasswordManager): Now that the transport handles the auth parameters, we can use transport.base as the auth uri and work around the python-2.4 bug. (HTTPBasicAuthHandler.http_error_401): Capture the auth scheme when the authentication succeeds.
* bzrlib/transport/http/_urllib.py: (HttpTransport_urllib.__init__): Extract authentication at construction time so that we don't have to do it at request build time. urllib2 will be happier without it. (HttpTransport_urllib._extract_auth): Moved from _urllib2_wrappers.Request.extract_auth. (HttpTransport_urllib._ask_password): Made private and do not require a 'request' parameter anymore. (HttpTransport_urllib._perform): The transport is now responsible for handling the auth parameters and provide them to the requests. And from there we can avoid the 401 roundtrips yeaaaaah! (Except the first one of course to determine the auth scheme).