changeset 34214:7e3f078b6f31

py3: use bytechr() in store._buildlowerencodefun()
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:27:50 +0900
parents 96808804b68f
children b4abc438a8c9
files mercurial/store.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Sun Sep 03 17:26:10 2017 +0900
+++ b/mercurial/store.py	Sun Sep 03 17:27:50 2017 +0900
@@ -157,11 +157,12 @@
     >>> f(b'the\\x07quick\\xADshot')
     'the~07quick~adshot'
     '''
-    cmap = dict([(chr(x), chr(x)) for x in xrange(127)])
+    xchr = pycompat.bytechr
+    cmap = dict([(xchr(x), xchr(x)) for x in xrange(127)])
     for x in _reserved():
-        cmap[chr(x)] = "~%02x" % x
+        cmap[xchr(x)] = "~%02x" % x
     for x in range(ord("A"), ord("Z") + 1):
-        cmap[chr(x)] = chr(x).lower()
+        cmap[xchr(x)] = xchr(x).lower()
     def lowerencode(s):
         return "".join([cmap[c] for c in s])
     return lowerencode