Mercurial > hg-stable
changeset 9347:d0474b184347
url: add support for custom handlers in extensions
author | Henrik Stuart <hg@hstuart.dk> |
---|---|
date | Tue, 11 Aug 2009 22:45:38 +0200 |
parents | bb3f8f692bc6 |
children | 954f7a879495 |
files | mercurial/url.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/url.py Wed Jul 15 11:26:47 2009 +0900 +++ b/mercurial/url.py Tue Aug 11 22:45:38 2009 +0200 @@ -487,6 +487,8 @@ authinfo = None return url, authinfo +handlerfuncs = [] + def opener(ui, authinfo=None): ''' construct an opener suitable for urllib2 @@ -507,6 +509,7 @@ 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