Show More
@@ -10,7 +10,7 b' from node import bin, hex' | |||||
10 | from remoterepo import remoterepository |
|
10 | from remoterepo import remoterepository | |
11 | from i18n import _ |
|
11 | from i18n import _ | |
12 | import repo, os, urllib, urllib2, urlparse, zlib, util, httplib |
|
12 | import repo, os, urllib, urllib2, urlparse, zlib, util, httplib | |
13 |
import errno, keepalive, socket, changegroup |
|
13 | import errno, keepalive, socket, changegroup | |
14 |
|
14 | |||
15 | class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm): |
|
15 | class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm): | |
16 | def __init__(self, ui): |
|
16 | def __init__(self, ui): | |
@@ -268,7 +268,7 b' class httprepository(remoterepository):' | |||||
268 | opener = urllib2.build_opener(*handlers) |
|
268 | opener = urllib2.build_opener(*handlers) | |
269 |
|
269 | |||
270 | # 1.0 here is the _protocol_ version |
|
270 | # 1.0 here is the _protocol_ version | |
271 |
opener.addheaders = [('User-agent', |
|
271 | opener.addheaders = [('User-agent', 'mercurial/proto-1.0')] | |
272 | urllib2.install_opener(opener) |
|
272 | urllib2.install_opener(opener) | |
273 |
|
273 | |||
274 | def url(self): |
|
274 | def url(self): |
@@ -10,8 +10,6 b' Mercurial version' | |||||
10 | """ |
|
10 | """ | |
11 |
|
11 | |||
12 | import os |
|
12 | import os | |
13 | import os.path |
|
|||
14 | import sys |
|
|||
15 | import re |
|
13 | import re | |
16 | import time |
|
14 | import time | |
17 |
|
15 | |||
@@ -29,16 +27,6 b' def get_version(doreload=False):' | |||||
29 | version = unknown_version |
|
27 | version = unknown_version | |
30 | return version |
|
28 | return version | |
31 |
|
29 | |||
32 | def get_useragent(): |
|
|||
33 | """Return some extended version information for the User-Agent |
|
|||
34 | field in http requests.""" |
|
|||
35 | hgver = get_version() |
|
|||
36 | pyver = '%s(%s)' % (sys.version.split()[0], hex(sys.hexversion)) |
|
|||
37 | ostype = os.name |
|
|||
38 | plat = sys.platform |
|
|||
39 | return 'mercurial/proto-1.0 (Python/%s; Mercurial/%s; %s/%s)' % \ |
|
|||
40 | (pyver, hgver, ostype, plat) |
|
|||
41 |
|
||||
42 | def write_version(version): |
|
30 | def write_version(version): | |
43 | """Overwrite version file.""" |
|
31 | """Overwrite version file.""" | |
44 | if version == get_version(): |
|
32 | if version == get_version(): |
General Comments 0
You need to be logged in to leave comments.
Login now