##// END OF EJS Templates
Merge (picking the version which has more fine-tuned detection)
Marcin Kasperski -
r82:0ea567eb merge default
parent child Browse files
Show More
@@ -120,7 +120,7 b' class HTTPPasswordHandler(object):'
120
120
121 # Loading .hg/hgrc [auth] section contents. If prefix is given,
121 # Loading .hg/hgrc [auth] section contents. If prefix is given,
122 # it will be used as a key to lookup password in the keyring.
122 # it will be used as a key to lookup password in the keyring.
123 auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url)
123 auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url, user)
124 if prefix_url:
124 if prefix_url:
125 keyring_url = prefix_url
125 keyring_url = prefix_url
126 else:
126 else:
@@ -199,7 +199,7 b' class HTTPPasswordHandler(object):'
199 self.last_reply = dict(realm=realm,authuri=authuri,user=user)
199 self.last_reply = dict(realm=realm,authuri=authuri,user=user)
200 return user, pwd
200 return user, pwd
201
201
202 def load_hgrc_auth(self, ui, base_url):
202 def load_hgrc_auth(self, ui, base_url, user):
203 """
203 """
204 Loading [auth] section contents from local .hgrc
204 Loading [auth] section contents from local .hgrc
205
205
@@ -237,14 +237,17 b' class HTTPPasswordHandler(object):'
237 except AttributeError:
237 except AttributeError:
238 try:
238 try:
239 # hg 1.8
239 # hg 1.8
240 from mercurial.url import readauthforuri
240 import mercurial.url
241 except ImportError:
241 readauthforuri = mercurial.url.readauthforuri
242 except (ImportError, AttributeError):
242 # hg 1.9
243 # hg 1.9
243 from mercurial.httpconnection import readauthforuri
244 import mercurial.httpconnection
244 try:
245 readauthforuri = mercurial.httpconnection.readauthforuri
246 if readauthforuri.func_code.co_argcount == 3:
247 # Since hg.0593e8f81c71
248 res = readauthforuri(local_ui, base_url, user)
249 else:
245 res = readauthforuri(local_ui, base_url)
250 res = readauthforuri(local_ui, base_url)
246 except:
247 res = readauthforuri(local_ui, base_url, '')
248 if res:
251 if res:
249 group, auth_token = res
252 group, auth_token = res
250 else:
253 else:
General Comments 0
You need to be logged in to leave comments. Login now