# HG changeset patch # User Henrik Stuart # Date 2009-08-11 20:45:38 # Node ID d0474b184347aa72fee34776a61a427a991ef607 # Parent bb3f8f692bc684797a93f2fedea8c7e6733d9d7a url: add support for custom handlers in extensions diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -487,6 +487,8 @@ def getauthinfo(path): authinfo = None return url, authinfo +handlerfuncs = [] + def opener(ui, authinfo=None): ''' construct an opener suitable for urllib2 @@ -507,6 +509,7 @@ def opener(ui, authinfo=None): handlers.extend((urllib2.HTTPBasicAuthHandler(passmgr), httpdigestauthhandler(passmgr))) + handlers.extend([h(ui, passmgr) for h in handlerfuncs]) opener = urllib2.build_opener(*handlers) # 1.0 here is the _protocol_ version