Mercurial > public > mercurial-scm > hg
comparison mercurial/httprepo.py @ 1359:51ac9a79f3e5
Set the user agent for httprepo communication
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 27 Sep 2005 18:30:54 -0700 |
parents | 84cf8834efb5 |
children | 524ca4a06f70 |
comparison
equal
deleted
inserted
replaced
1358:20abfd48e21c | 1359:51ac9a79f3e5 |
---|---|
57 passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm() | 57 passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm() |
58 passmgr.add_password(None, host, user, passwd) | 58 passmgr.add_password(None, host, user, passwd) |
59 authinfo = urllib2.ProxyBasicAuthHandler(passmgr) | 59 authinfo = urllib2.ProxyBasicAuthHandler(passmgr) |
60 | 60 |
61 opener = urllib2.build_opener(proxy_handler, authinfo) | 61 opener = urllib2.build_opener(proxy_handler, authinfo) |
62 # 1.0 here is the _protocol_ version | |
63 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] | |
62 urllib2.install_opener(opener) | 64 urllib2.install_opener(opener) |
63 | 65 |
64 def dev(self): | 66 def dev(self): |
65 return -1 | 67 return -1 |
66 | 68 |