[hg] prompthooks.py fix import readauthforuri for 1.9

readautoforuri was moved to mercurial.httpconnection in 1.9
This commit is contained in:
Kirill Likhodedov
2011-07-11 12:56:34 +04:00
parent b0dd32855e
commit 5cbb1b7398
@@ -176,8 +176,12 @@ def find_user_password(self, realm, authuri):
return self.readauthtoken(authuri)
else:
def read_hgrc_authtoken(ui, authuri):
# hg 1.8
from mercurial.url import readauthforuri
try:
# hg 1.8
from mercurial.url import readauthforuri
except ImportError:
# hg 1.9: readauthforuri moved to httpconnection
from mercurial.httpconnection import readauthforuri
res = readauthforuri(self.ui, authuri)
if res:
group, auth = res