Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
Thomas Arendsen Hein
- Wed, 18 Nov 2009 16:09:00
Show More
mercurial/httprepo.py
0
+5
-2
@@
-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 . from local( 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
mercurial/sshrepo.py
0
+5
-2
@@
-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 . from local( 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
tests/test-branchmap
0
+35
0
@@
-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
tests/test-branchmap.out
0
+6
0
@@
-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
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages