##// END OF EJS Templates
py3: make encodefun in store.py compatible with py3k...
Mateusz Kwapich -
r30077:8f42d8c4 default
parent child Browse files
Show More
@@ -16,6 +16,7 b' from .i18n import _'
16 from . import (
16 from . import (
17 error,
17 error,
18 parsers,
18 parsers,
19 pycompat,
19 scmutil,
20 scmutil,
20 util,
21 util,
21 )
22 )
@@ -98,11 +99,20 b' def _buildencodefun():'
98 'the\\x07quick\\xadshot'
99 'the\\x07quick\\xadshot'
99 '''
100 '''
100 e = '_'
101 e = '_'
101 cmap = dict([(chr(x), chr(x)) for x in xrange(127)])
102 if pycompat.ispy3:
103 xchr = lambda x: bytes([x])
104 asciistr = bytes(xrange(127))
105 else:
106 xchr = chr
107 asciistr = map(chr, xrange(127))
108 capitals = list(range(ord("A"), ord("Z") + 1))
109
110 cmap = {x:x for x in asciistr}
102 for x in _reserved():
111 for x in _reserved():
103 cmap[chr(x)] = "~%02x" % x
112 cmap[xchr(x)] = "~%02x" % x
104 for x in list(range(ord("A"), ord("Z") + 1)) + [ord(e)]:
113 for x in capitals + [ord(e)]:
105 cmap[chr(x)] = e + chr(x).lower()
114 cmap[xchr(x)] = e + xchr(x).lower()
115
106 dmap = {}
116 dmap = {}
107 for k, v in cmap.iteritems():
117 for k, v in cmap.iteritems():
108 dmap[v] = k
118 dmap[v] = k
@@ -134,7 +134,6 b''
134 mercurial/sshserver.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
134 mercurial/sshserver.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
135 mercurial/statichttprepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at byterange.py:*)
135 mercurial/statichttprepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at byterange.py:*)
136 mercurial/store.py: error importing module: <NameError> name 'xrange' is not defined (line *)
136 mercurial/store.py: error importing module: <NameError> name 'xrange' is not defined (line *)
137 mercurial/streamclone.py: error importing: <TypeError> can't concat bytes to str (error at store.py:*)
138 mercurial/subrepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
137 mercurial/subrepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
139 mercurial/templatefilters.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
138 mercurial/templatefilters.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
140 mercurial/templatekw.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
139 mercurial/templatekw.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'stringio' (error at patch.py:*)
General Comments 0
You need to be logged in to leave comments. Login now