changeset 424:9294dce4b633

Allow override of HTTP_PROXY, http_proxy and no_proxy; make no_proxy work. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Allow override of HTTP_PROXY, http_proxy and no_proxy; make no_proxy work. manifest hash: cfddccef1e8acaa8b06e652e5bbc274d31f0df1d -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCtIp/W7P1GVgWeRoRAgNRAJ4//Ptbq9Cba7S2L5ltvP92gcijZQCeKuU/ S/togHQXp34v2ypVH+8wyP4= =jpn2 -----END PGP SIGNATURE-----
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 18 Jun 2005 21:56:31 +0100
parents 25afb21d97ba
children 719663b7f235
files mercurial/hg.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Jun 18 16:32:41 2005 +0100
+++ b/mercurial/hg.py	Sat Jun 18 21:56:31 2005 +0100
@@ -1331,9 +1331,13 @@
         self.ui = ui
         no_list = [ "localhost", "127.0.0.1" ]
         host = ui.config("http_proxy", "host")
+        if host is None:
+            host = os.environ.get("http_proxy")
         user = ui.config("http_proxy", "user")
         passwd = ui.config("http_proxy", "passwd")
         no = ui.config("http_proxy", "no")
+        if no is None:
+            no = os.environ.get("no_proxy")
         if no:
             no_list = no_list + no.split(",")
             
@@ -1346,6 +1350,9 @@
 
         # Note: urllib2 takes proxy values from the environment and those will
         # take precedence
+        for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
+            if os.environ.has_key(env):
+                del os.environ[env]
 
         proxy_handler = urllib2.BaseHandler()
         if host and not no_proxy: