##// END OF EJS Templates
#49 Url-stored usernames should work again.
Marcin Kasperski -
r212:d9a57074 default
parent child Browse files
Show More
@@ -1,5 +1,8 b''
1 1.1.1
2 ~~~~~~~~~~~~~~~~~~
1
3
2 ~~~~~~~~~~~~~~~~~~
4 #49 Fixed the bug due to url-stored usernames did not work (introduced
5 in 1.0.0 and not completely fixed in 1.0.1).
3
6
4 #50 Bad doc url in error message
7 #50 Bad doc url in error message
5
8
@@ -310,32 +310,36 b' class HTTPPasswordHandler(object):'
310 if urllib_user and urllib_pwd:
310 if urllib_user and urllib_pwd:
311 return urllib_user, urllib_pwd, self.SRC_URLCACHE, base_url
311 return urllib_user, urllib_pwd, self.SRC_URLCACHE, base_url
312
312
313 actual_user = url_user or urllib_user
314
313 # Consult configuration to normalize url to prefix, and find username
315 # Consult configuration to normalize url to prefix, and find username
314 # (and maybe password)
316 # (and maybe password)
315 auth_user, auth_pwd, keyring_url = self.get_url_config(
317 auth_user, auth_pwd, keyring_url = self.get_url_config(
316 ui, parsed_url, url_user)
318 ui, parsed_url, actual_user)
317 if auth_user and url_user and (url_user != auth_user):
319 if auth_user and actual_user and (actual_user != auth_user):
318 raise util.Abort(_('keyring: username for %s specified both in repository path (%s) and in .hg/hgrc/[auth] (%s). Please, leave only one of those' % (base_url, url_user, auth_user)))
320 raise util.Abort(_('keyring: username for %s specified both in repository path (%s) and in .hg/hgrc/[auth] (%s). Please, leave only one of those' % (base_url, actual_user, auth_user)))
319 if auth_user and auth_pwd:
321 if auth_user and auth_pwd:
320 return auth_user, auth_pwd, self.SRC_CFGAUTH, keyring_url
322 return auth_user, auth_pwd, self.SRC_CFGAUTH, keyring_url
321
323
324 actual_user = actual_user or auth_user
325
322 if skip_caches:
326 if skip_caches:
323 return auth_user, None, None, keyring_url
327 return actual_user, None, None, keyring_url
324
328
325 # Check memory cache (reuse )
329 # Check memory cache (reuse )
326 # Checking the memory cache (there may be many http calls per command)
330 # Checking the memory cache (there may be many http calls per command)
327 cached_pwd = self.pwd_cache.check(realm, keyring_url, auth_user)
331 cached_pwd = self.pwd_cache.check(realm, keyring_url, actual_user)
328 if cached_pwd:
332 if cached_pwd:
329 return auth_user, cached_pwd, self.SRC_MEMCACHE, keyring_url
333 return actual_user, cached_pwd, self.SRC_MEMCACHE, keyring_url
330
334
331 # Load from keyring.
335 # Load from keyring.
332 if auth_user:
336 if actual_user:
333 ui.debug(_("keyring: looking for password (user %s, url %s)\n") % (auth_user, keyring_url))
337 ui.debug(_("keyring: looking for password (user %s, url %s)\n") % (actual_user, keyring_url))
334 keyring_pwd = password_store.get_http_password(keyring_url, auth_user)
338 keyring_pwd = password_store.get_http_password(keyring_url, actual_user)
335 if keyring_pwd:
339 if keyring_pwd:
336 return auth_user, keyring_pwd, self.SRC_KEYRING, keyring_url
340 return actual_user, keyring_pwd, self.SRC_KEYRING, keyring_url
337
341
338 return auth_user, None, None, keyring_url
342 return actual_user, None, None, keyring_url
339
343
340 @staticmethod
344 @staticmethod
341 def prompt_interactively(ui, user, realm, url):
345 def prompt_interactively(ui, user, realm, url):
General Comments 0
You need to be logged in to leave comments. Login now