diff options
author | Andrej Shadura <andrewsh@debian.org> | 2018-10-04 21:01:31 +0200 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-10-04 21:01:31 +0200 |
commit | 2216111155cd418b672bf52484d5bc2732fccf71 (patch) | |
tree | da0c27f013877fed8c617ea0f22c6173b7c78272 | |
parent | 385778100dad9bed324a46f430ecf6df24af2d30 (diff) |
Import Upstream version 1.1.7
-rw-r--r-- | HISTORY.txt | 14 | ||||
-rw-r--r-- | PKG-INFO | 2 | ||||
-rw-r--r-- | mercurial_keyring.egg-info/PKG-INFO | 2 | ||||
-rw-r--r-- | mercurial_keyring.egg-info/requires.txt | 2 | ||||
-rw-r--r-- | mercurial_keyring.py | 22 | ||||
-rw-r--r-- | setup.py | 2 |
6 files changed, 35 insertions, 9 deletions
diff --git a/HISTORY.txt b/HISTORY.txt index 8bae494..7b7ff95 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,17 @@ +1.1.7 +~~~~~~~~~~~~~~~~~~ + +#52 hg keyring_check and hg keyring_clear did not work since +Mercurial 3.9 (incompatibility caused by commit 2c019aac6b99, +introducing passwdb). + +1.1.6 +~~~~~~~~~~~~~~~~~~ + +Fixed NameError showing up in some password saving scenarios, in +particular in case of password save failures (thanks to Andrew +Taumoefolau for reporting and fixing). + 1.1.5 ~~~~~~~~~~~~~~~~~~ @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mercurial_keyring -Version: 1.1.5 +Version: 1.1.7 Summary: Mercurial Keyring Extension Home-page: http://bitbucket.org/Mekk/mercurial_keyring Author: Marcin Kasperski diff --git a/mercurial_keyring.egg-info/PKG-INFO b/mercurial_keyring.egg-info/PKG-INFO index 5bb42d5..71de5a1 100644 --- a/mercurial_keyring.egg-info/PKG-INFO +++ b/mercurial_keyring.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mercurial-keyring -Version: 1.1.5 +Version: 1.1.7 Summary: Mercurial Keyring Extension Home-page: http://bitbucket.org/Mekk/mercurial_keyring Author: Marcin Kasperski diff --git a/mercurial_keyring.egg-info/requires.txt b/mercurial_keyring.egg-info/requires.txt index d020bbf..676649e 100644 --- a/mercurial_keyring.egg-info/requires.txt +++ b/mercurial_keyring.egg-info/requires.txt @@ -1,2 +1,2 @@ keyring>=0.3 -mercurial_extension_utils>=1.2.0
\ No newline at end of file +mercurial_extension_utils>=1.2.0 diff --git a/mercurial_keyring.py b/mercurial_keyring.py index 7f70e57..f9baa5f 100644 --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -253,6 +253,14 @@ _re_http_url = re.compile(r'^https?://') def is_http_path(url): return bool(_re_http_url.search(url)) + +def make_passwordmgr(ui): + """Constructing passwordmgr in a way compatible with various mercurials""" + if hasattr(ui, 'httppasswordmgrdb'): + return passwordmgr(ui, ui.httppasswordmgrdb) + else: + return passwordmgr(ui) + ############################################################ # HTTP password management ############################################################ @@ -394,9 +402,13 @@ class HTTPPasswordHandler(object): _debug(ui, _("Saving password for %s to keyring") % user) try: password_store.set_http_password(final_url, user, pwd) - except keyring.errors.PasswordSetError, e: - ui.traceback() - ui.warn(_("warning: failed to save password in keyring\n")) + except Exception, e: + keyring = import_keyring() + if isinstance(e, keyring.errors.PasswordSetError): + ui.traceback() + ui.warn(_("warning: failed to save password in keyring\n")) + else: + raise e # Saving password to the memory cache self.pwd_cache.store(realm, final_url, user, pwd) @@ -762,7 +774,7 @@ def cmd_keyring_check(ui, repo, *path_args, **opts): # pylint: disable=unused- ui.status(_(" %s: non-http path (%s)\n") % (name, url)) continue user, pwd, source, final_url = handler.get_credentials( - passwordmgr(ui), name, url) + make_passwordmgr(ui), name, url) if pwd: ui.status(_(" %s: password available, source: %s, bound to user %s, url %s\n") % ( name, source, user, final_url)) @@ -797,7 +809,7 @@ def cmd_keyring_clear(ui, repo, path, **opts): # pylint: disable=unused-argumen handler = HTTPPasswordHandler() user, pwd, source, final_url = handler.get_credentials( - passwordmgr(ui), path, path_url) + make_passwordmgr(ui), path, path_url) if not user: ui.status(_("Username not configured for url %s\n") % final_url) return @@ -1,5 +1,5 @@ -VERSION = '1.1.5' +VERSION = '1.1.7' # pylint: disable=unused-import |