Commits

Brodie Rao committed 0ff7f77

Refreshing queue

Comments (0)

Files changed (2)

 diff --git a/mercurial/url.py b/mercurial/url.py
 --- a/mercurial/url.py
 +++ b/mercurial/url.py
-@@ -23,6 +23,184 @@ def _urlunparse(scheme, netloc, path, pa
+@@ -23,6 +23,191 @@ def _urlunparse(scheme, netloc, path, pa
          result = scheme + '://' + result[len(scheme + ':'):]
      return result
  
 +        return s
 +
 +    def authinfo(self):
++        user, passwd = self.user, self.passwd
++        try:
++            self.user, self.passwd = None, None
++            s = str(self)
++        finally:
++            self.user, self.passwd = user, passwd
 +        if not self.user:
-+            return None
-+        return (None, (str(self), self.host), self.user, self.passwd or '')
++            return (s, None)
++        return (s, (None, (str(self), self.host),
++                    self.user, self.passwd or ''))
 +
 +def has_scheme(path):
 +    return bool(url(path).scheme)
  
          # urllib cannot handle URLs with embedded user or passwd
 -        self._url, authinfo = url.getauthinfo(path)
-+        self._url, authinfo = str(u), u.authinfo()
++        self._url, authinfo = u.authinfo()
  
          self.ui = ui
          self.ui.debug('using %s\n' % self._url)
          self.root = path
 -        self.path, authinfo = url.getauthinfo(path.rstrip('/') + "/.hg")
 +        u = url.url(path.rstrip('/') + "/.hg")
-+        self.path, authinfo = str(u), u.authinfo()
++        self.path, authinfo = u.authinfo()
  
          opener = build_opener(ui, authinfo)
          self.opener = opener(self.path)