##// END OF EJS Templates
merge with crew-stable
Thomas Arendsen Hein -
r9880:a1886801 merge default
parent child Browse files
Show More
@@ -154,10 +154,13 b' class httprepository(repo.repository):'
154 for branchpart in d.splitlines():
154 for branchpart in d.splitlines():
155 branchheads = branchpart.split(' ')
155 branchheads = branchpart.split(' ')
156 branchname = urllib.unquote(branchheads[0])
156 branchname = urllib.unquote(branchheads[0])
157 # Earlier servers (1.3.x) send branch names in (their) local
158 # charset. The best we can do is assume it's identical to our
159 # own local charset, in case it's not utf-8.
157 try:
160 try:
158 branchname.decode('utf-8', 'strict')
161 branchname.decode('utf-8')
159 except UnicodeDecodeError:
162 except UnicodeDecodeError:
160 branchname = encoding.tolocal(branchname)
163 branchname = encoding.fromlocal(branchname)
161 branchheads = [bin(x) for x in branchheads[1:]]
164 branchheads = [bin(x) for x in branchheads[1:]]
162 branchmap[branchname] = branchheads
165 branchmap[branchname] = branchheads
163 return branchmap
166 return branchmap
@@ -173,10 +173,13 b' class sshrepository(repo.repository):'
173 for branchpart in d.splitlines():
173 for branchpart in d.splitlines():
174 branchheads = branchpart.split(' ')
174 branchheads = branchpart.split(' ')
175 branchname = urllib.unquote(branchheads[0])
175 branchname = urllib.unquote(branchheads[0])
176 # Earlier servers (1.3.x) send branch names in (their) local
177 # charset. The best we can do is assume it's identical to our
178 # own local charset, in case it's not utf-8.
176 try:
179 try:
177 branchname.decode('utf-8', 'strict')
180 branchname.decode('utf-8')
178 except UnicodeDecodeError:
181 except UnicodeDecodeError:
179 branchname = encoding.tolocal(branchname)
182 branchname = encoding.fromlocal(branchname)
180 branchheads = [bin(x) for x in branchheads[1:]]
183 branchheads = [bin(x) for x in branchheads[1:]]
181 branchmap[branchname] = branchheads
184 branchmap[branchname] = branchheads
182 return branchmap
185 return branchmap
@@ -21,3 +21,38 b' hg --encoding utf-8 -R b push | sed "s/$'
21 hg -R a --encoding utf-8 log
21 hg -R a --encoding utf-8 log
22
22
23 kill `cat hg.pid`
23 kill `cat hg.pid`
24
25
26 # verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
27
28 cat <<EOF > oldhg
29 import sys
30 from mercurial import ui, hg, commands
31
32 class StdoutWrapper(object):
33 def __init__(self, stdout):
34 self._file = stdout
35
36 def write(self, data):
37 if data == '47\n':
38 # latin1 encoding is one %xx (3 bytes) shorter
39 data = '44\n'
40 elif data.startswith('%C3%A6 '):
41 # translate to latin1 encoding
42 data = '%%E6 %s' % data[7:]
43 self._file.write(data)
44
45 def __getattr__(self, name):
46 return getattr(self._file, name)
47
48 sys.stdout = StdoutWrapper(sys.stdout)
49 sys.stderr = StdoutWrapper(sys.stderr)
50
51 myui = ui.ui()
52 repo = hg.repository(myui, 'a')
53 commands.serve(myui, repo, stdio=True)
54 EOF
55
56 echo baz >> b/foo
57 hg -R b ci -m baz
58 hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
@@ -34,3 +34,9 b' user: test'
34 date: Thu Jan 01 00:00:00 1970 +0000
34 date: Thu Jan 01 00:00:00 1970 +0000
35 summary: foo
35 summary: foo
36
36
37 pushing to ssh://dummy/
38 searching for changes
39 remote: adding changesets
40 remote: adding manifests
41 remote: adding file changes
42 remote: added 1 changesets with 1 changes to 1 files
General Comments 0
You need to be logged in to leave comments. Login now