Patrick Mézard avatar Patrick Mézard committed 049fac0

Handle httpconnection.readauthforuri changes (hg.0593e8f81c71)

Comments (0)

Files changed (1)

         # Loading .hg/hgrc [auth] section contents. If prefix is given,
         # it will be used as a key to lookup password in the keyring.
-        auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url)
+        auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url, user)
         if prefix_url:
             keyring_url = prefix_url
         self.last_reply = dict(realm=realm,authuri=authuri,user=user)
         return user, pwd
-    def load_hgrc_auth(self, ui, base_url):
+    def load_hgrc_auth(self, ui, base_url, user):
         Loading [auth] section contents from local .hgrc
                 # hg 1.9
                 import mercurial.httpconnection
                 readauthforuri = mercurial.httpconnection.readauthforuri
-            res = readauthforuri(local_ui, base_url)
+            if readauthforuri.func_code.co_argcount == 3:
+                # Since hg.0593e8f81c71
+                res = readauthforuri(local_ui, base_url, user)
+            else:
+                res = readauthforuri(local_ui, base_url)
             if res:
                 group, auth_token = res
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.