Set the user agent for httprepo communication
authorMatt Mackall <mpm@selenic.com>
Tue, 27 Sep 2005 18:30:54 -0700
changeset 1359 51ac9a79f3e5
parent 1358 20abfd48e21c
child 1360 7d439981bec4
child 1361 f6d73b26dbdb
child 1371 68e84563c540
Set the user agent for httprepo communication
mercurial/httprepo.py
--- a/mercurial/httprepo.py	Tue Sep 27 15:23:34 2005 -0700
+++ b/mercurial/httprepo.py	Tue Sep 27 18:30:54 2005 -0700
@@ -59,6 +59,8 @@
             authinfo = urllib2.ProxyBasicAuthHandler(passmgr)
 
         opener = urllib2.build_opener(proxy_handler, authinfo)
+        # 1.0 here is the _protocol_ version
+        opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
         urllib2.install_opener(opener)
 
     def dev(self):