[PATCH 1 of 1] url: add support for custom handlers in extensions
Henrik Stuart
hg at hstuart.dk
Wed Aug 12 13:52:18 CDT 2009
# HG changeset patch
# User Henrik Stuart <hg at hstuart.dk>
# Date 1250023538 -7200
# Node ID 21a8f7e1181e79bc505484b809a8052f7f84ab43
# Parent 9be91129c96e4c98360744ca06e48dc5d5b7d23c
url: add support for custom handlers in extensions
diff -r 9be91129c96e -r 21a8f7e1181e mercurial/url.py
--- a/mercurial/url.py Wed Aug 12 11:50:27 2009 +0200
+++ 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
More information about the Mercurial-devel
mailing list