[thg-dev] IE proxy settings extension

André Sintzoff andre.sintzoff at gmail.com
Fri Nov 5 08:19:30 CDT 2010


2010/11/4 André Sintzoff <andre.sintzoff at gmail.com>:
> 2010/11/3 Steve Borho <steve at borho.org>:
>> Attached is an extension that I've just written with the intention of
>> automatically reading proxy settings from the Internet Explorer's
>> registry configuration.   In many corporate environments, proxies are
>> configured to be discovered by DHCP and friends.  If the user enables
>> this extension, Mercurial will also autodetect these settings and
>> stuff "just works".
>>
>> I've run it on my Windows machines, but I do not use proxies so it
>> doesn't do much. I'm hoping some people who do use proxies can test
>> this for me and give me some feedback on what works and what doesn't.
>
> I'm using privoxy (http://www.privoxy.org/) which is a local proxy.
>
> What works:
> - getproxies_registry() as http_proxy.host has the value set in
> Internet proxy preferences
>
> D:\hg-repo\hg>hg incoming
> setting http_proxy.host = http://127.0.0.1:8118
> setting http_proxy.no = <local>
>
> What doesn't:
> - abort: error: A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond
>
> And with a more classical proxy instead of privoxy, no more success.
>
> It seems that no http request is sent to the proxy.
>
> André
>

Thanks to NicDumZ, I find a solution.
Replacing uisetup by reposetup modifies really ui.config.
As uisetup is only called via     extensions.loadall(lui)  #dispatch:492
and the parameter is "lui" and not "ui"

diff -r e57f9059d1be hgext/ieproxy.py
--- a/hgext/ieproxy.py  Fri Nov 05 14:15:23 2010 +0100
+++ b/hgext/ieproxy.py  Fri Nov 05 14:16:05 2010 +0100
@@ -107,7 +107,7 @@
                 if not adNode:
                     break

-def uisetup(ui):
+def reposetup(ui):
     proxies, overrides = getproxies_registry()
     if 'http' in proxies:
         ui.setconfig('http_proxy', 'host', proxies['http'])


André


More information about the Mercurial-devel mailing list