diff mercurial/hg.py @ 429:688d03d6997a

Pull from TAH -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pull from TAH manifest hash: 600d04efbd836d555d11a3bd9d821d1d8c0a9790 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuPFxywK+sNU5EO8RAjfzAKC18Zc2EOkXhy1zcpgGnyPHnFMdmgCfW5Ut I5HSWqZMt8H0WJx1Or7ajNc= =27D5 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 21 Jun 2005 21:04:49 -0800
parents 183c87d4e1a0 8c90ab5644c9
children 08f00b6494f4
line wrap: on
line diff
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1365,9 +1365,15 @@ class remoterepository:
         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")
+        if host and host.startswith('http://'):
+            host = host[7:]
         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(",")
             
@@ -1380,6 +1386,9 @@ class remoterepository:
 
         # 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: