# HG changeset patch # User Steve Borho # Date 2011-02-14 21:42:30 # Node ID 131b19eb50e1337dc04855feaf5d237d876a60fc # Parent ff765ca7c2c1a01fda9cc0bc4363732fce068c18 passwordmgr.readauthtoken() has been moved into a utility function diff --git a/mercurial_keyring.py b/mercurial_keyring.py --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -229,8 +229,17 @@ class HTTPPasswordHandler(object): local_ui = _ui(ui) if repo_root: local_ui.readconfig(os.path.join(repo_root, ".hg", "hgrc")) - local_passwordmgr = passwordmgr(local_ui) - auth_token = local_passwordmgr.readauthtoken(base_url) + try: + local_passwordmgr = passwordmgr(local_ui) + auth_token = local_passwordmgr.readauthtoken(base_url) + except AttributeError: + # hg 1.8 + from mercurial.url import readauthforuri + res = readauthforuri(local_ui, base_url) + if res: + group, auth_token = res + else: + auth_token = None if auth_token: username = auth_token.get('username') password = auth_token.get('password')