comparison 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
comparison
equal deleted inserted replaced
428:183c87d4e1a0 429:688d03d6997a
1363 def __init__(self, ui, path): 1363 def __init__(self, ui, path):
1364 self.url = path 1364 self.url = path
1365 self.ui = ui 1365 self.ui = ui
1366 no_list = [ "localhost", "127.0.0.1" ] 1366 no_list = [ "localhost", "127.0.0.1" ]
1367 host = ui.config("http_proxy", "host") 1367 host = ui.config("http_proxy", "host")
1368 if host is None:
1369 host = os.environ.get("http_proxy")
1370 if host and host.startswith('http://'):
1371 host = host[7:]
1368 user = ui.config("http_proxy", "user") 1372 user = ui.config("http_proxy", "user")
1369 passwd = ui.config("http_proxy", "passwd") 1373 passwd = ui.config("http_proxy", "passwd")
1370 no = ui.config("http_proxy", "no") 1374 no = ui.config("http_proxy", "no")
1375 if no is None:
1376 no = os.environ.get("no_proxy")
1371 if no: 1377 if no:
1372 no_list = no_list + no.split(",") 1378 no_list = no_list + no.split(",")
1373 1379
1374 no_proxy = 0 1380 no_proxy = 0
1375 for h in no_list: 1381 for h in no_list:
1378 path == "http://" + h): 1384 path == "http://" + h):
1379 no_proxy = 1 1385 no_proxy = 1
1380 1386
1381 # Note: urllib2 takes proxy values from the environment and those will 1387 # Note: urllib2 takes proxy values from the environment and those will
1382 # take precedence 1388 # take precedence
1389 for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
1390 if os.environ.has_key(env):
1391 del os.environ[env]
1383 1392
1384 proxy_handler = urllib2.BaseHandler() 1393 proxy_handler = urllib2.BaseHandler()
1385 if host and not no_proxy: 1394 if host and not no_proxy:
1386 proxy_handler = urllib2.ProxyHandler({"http" : "http://" + host}) 1395 proxy_handler = urllib2.ProxyHandler({"http" : "http://" + host})
1387 1396