changeset 42458:c1bf63ac30c5

py3: use .startswith() instead of bytes[0] Doing bytes[0] will return the ascii value of that position which breaks comparison with a bytechar. This makes test-absorb.t work again on py3. Differential Revision: https://phab.mercurial-scm.org/D6508
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 11 Jun 2019 15:46:07 +0300
parents 43c8f72184f4
children d3c81439e2ee
files hgext/absorb.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/absorb.py	Sun Jun 09 22:23:41 2019 +0900
+++ b/hgext/absorb.py	Tue Jun 11 15:46:07 2019 +0300
@@ -871,7 +871,7 @@
     patchlines = mdiff.splitnewlines(buf.getvalue())
     # hunk.prettystr() will update hunk.removed
     a2 = a1 + hunk.removed
-    blines = [l[1:] for l in patchlines[1:] if l[0] != '-']
+    blines = [l[1:] for l in patchlines[1:] if not l.startswith('-')]
     return path, (a1, a2, blines)
 
 def overlaydiffcontext(ctx, chunks):