def read_hgrc_authtoken(ui, authuri): # hg 1.8 from mercurial.url import readauthforuri res = readauthforuri(self.ui, authuri) if res: group, auth = res return auth else: return None
def read_hgrc_authtoken(ui, authuri): try: # since hg 1.8 from mercurial.url import readauthforuri except ImportError: # hg 1.9: readauthforuri moved to httpconnection from mercurial.httpconnection import readauthforuri from inspect import getargspec args, _, _, _ = getargspec(readauthforuri) if len(args) == 2: res = readauthforuri(self.ui, authuri) else: # since hg 1.9.2 readauthforuri accepts 3 required arguments instead of 2 res = readauthforuri(self.ui, authuri, "") if res: group, auth = res return auth else: return None
def read_hgrc_authtoken(ui, authuri): 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 return auth else: return None