absorb: add a pycompat.bytestr() to fix --edit-lines functionality on Python 3
authorAugie Fackler <augie@google.com>
Wed, 16 Jan 2019 11:33:43 -0500
changeset 41260 c146651a78e1
parent 41259 194e43c2bac9
child 41261 1198c86beb73
absorb: add a pycompat.bytestr() to fix --edit-lines functionality on Python 3 Differential Revision: https://phab.mercurial-scm.org/D5610
contrib/python3-whitelist
hgext/absorb.py
--- a/contrib/python3-whitelist	Wed Jan 16 11:03:04 2019 -0500
+++ b/contrib/python3-whitelist	Wed Jan 16 11:33:43 2019 -0500
@@ -1,4 +1,5 @@
 test-abort-checkin.t
+test-absorb-edit-lines.t
 test-absorb-filefixupstate.py
 test-absorb-phase.t
 test-absorb-rename.t
--- a/hgext/absorb.py	Wed Jan 16 11:03:04 2019 -0500
+++ b/hgext/absorb.py	Wed Jan 16 11:33:43 2019 -0500
@@ -489,7 +489,8 @@
             if l[colonpos - 1:colonpos + 2] != ' : ':
                 raise error.Abort(_('malformed line: %s') % l)
             linecontent = l[colonpos + 2:]
-            for i, ch in enumerate(l[leftpadpos:colonpos - 1]):
+            for i, ch in enumerate(
+                    pycompat.bytestr(l[leftpadpos:colonpos - 1])):
                 if ch == 'y':
                     contents[visiblefctxs[i][0]] += linecontent
         # chunkstats is hard to calculate if anything changes, therefore