D5610: absorb: add a pycompat.bytestr() to fix --edit-lines functionality on Python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jan 16 12:22:13 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc146651a78e1: absorb: add a pycompat.bytestr() to fix --edit-lines functionality on Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5610?vs=13271&id=13290

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

AFFECTED FILES
  contrib/python3-whitelist
  hgext/absorb.py

CHANGE DETAILS

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -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
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -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



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


More information about the Mercurial-devel mailing list