Patchwork D2071: py3: use pycompat.bytechr instead of chr

login
register
mail settings
Submitter phabricator
Date Feb. 7, 2018, 9:01 a.m.
Message ID <differential-rev-PHID-DREV-ypx2wi2csil6hkcxitgy-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27405/
State Superseded
Headers show

Comments

phabricator - Feb. 7, 2018, 9:01 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2071

AFFECTED FILES
  mercurial/mdiff.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -465,9 +465,9 @@ 
     def fmtline(line):
         l = len(line)
         if l <= 26:
-            l = chr(ord('A') + l - 1)
+            l = pycompat.bytechr(ord('A') + l - 1)
         else:
-            l = chr(l - 26 + ord('a') - 1)
+            l = pycompat.bytechr(l - 26 + ord('a') - 1)
         return '%c%s\n' % (l, util.b85encode(line, True))
 
     def chunk(text, csize=52):