import mercurial.url import urllib_gssapi class HTTPSPNEGOAuthHandler(urllib_gssapi.HTTPSPNEGOAuthHandler): def __init__(self, ui=None, passmgr=None): self.retried = 0 def http_error_401(self, req, fp, code, msg, headers): schemes = [s.strip() for s in headers.get("WWW-Authenticate", "").split(",")] if ('Negotiate' not in schemes): return None return super().http_error_401(req, fp, code, msg, headers) def uisetup(ui): mercurial.url.handlerfuncs.append(HTTPSPNEGOAuthHandler)