Mercurial > public > mercurial-scm > hg
comparison mercurial/url.py @ 29379:fc777c855d66
largefiles: make cloning not ask two times about password (issue4883)
Before this commit url.opener overwritten stored password
for connection with given url/user even when
new password for given connection was not filled. This
commit makes opener overwrites saved authentication only
when it contains password.
author | liscju <piotr.listkiewicz@gmail.com> |
---|---|
date | Thu, 09 Jun 2016 12:41:57 +0200 |
parents | fea71f66ebff |
children | 0c741fd6158a |
comparison
equal
deleted
inserted
replaced
29378:fea71f66ebff | 29379:fc777c855d66 |
---|---|
491 | 491 |
492 handlers.append(proxyhandler(ui)) | 492 handlers.append(proxyhandler(ui)) |
493 | 493 |
494 passmgr = passwordmgr(ui, ui.httppasswordmgrdb) | 494 passmgr = passwordmgr(ui, ui.httppasswordmgrdb) |
495 if authinfo is not None: | 495 if authinfo is not None: |
496 passmgr.add_password(*authinfo) | 496 realm, uris, user, passwd = authinfo |
497 user, passwd = authinfo[2:4] | 497 saveduser, savedpass = passmgr.find_stored_password(uris[0]) |
498 if user != saveduser or passwd: | |
499 passmgr.add_password(realm, uris, user, passwd) | |
498 ui.debug('http auth: user %s, password %s\n' % | 500 ui.debug('http auth: user %s, password %s\n' % |
499 (user, passwd and '*' * len(passwd) or 'not set')) | 501 (user, passwd and '*' * len(passwd) or 'not set')) |
500 | 502 |
501 handlers.extend((httpbasicauthhandler(passmgr), | 503 handlers.extend((httpbasicauthhandler(passmgr), |
502 httpdigestauthhandler(passmgr))) | 504 httpdigestauthhandler(passmgr))) |