comparison hgext/factotum.py @ 29377:2c019aac6b99

url: extract password database from password manager So far password manager was keeping authentication information so opening new connection and creating new password manager made all saved authentication information lost. This commit separates password manager and password database to make it possible to reuse saved authentication information. This commit violates code checker because it adds add_password method (name with underscore) to passwordmgr object to provide method required by urllib2.
author liscju <piotr.listkiewicz@gmail.com>
date Sun, 05 Jun 2016 23:36:23 +0200
parents bacca31f4835
children 21b568820a3c
comparison
equal deleted inserted replaced
29376:113d0b23321a 29377:2c019aac6b99
100 return func 100 return func
101 return decorator 101 return decorator
102 102
103 @monkeypatch_method(passwordmgr) 103 @monkeypatch_method(passwordmgr)
104 def find_user_password(self, realm, authuri): 104 def find_user_password(self, realm, authuri):
105 user, passwd = urlreq.httppasswordmgrwithdefaultrealm.find_user_password( 105 user, passwd = self.passwddb.find_user_password(realm, authuri)
106 self, realm, authuri)
107 if user and passwd: 106 if user and passwd:
108 self._writedebug(user, passwd) 107 self._writedebug(user, passwd)
109 return (user, passwd) 108 return (user, passwd)
110 109
111 prefix = '' 110 prefix = ''