diff mercurial/patch.py @ 46030:2cf61e66c6d0

merge with stable
author Augie Fackler <augie@google.com>
date Thu, 03 Dec 2020 14:15:39 -0500
parents 89a2afe31e82 210f9b8d7bbd
children 416ecdaa12df
line wrap: on
line diff
--- a/mercurial/patch.py	Wed Dec 02 12:33:51 2020 -0800
+++ b/mercurial/patch.py	Thu Dec 03 14:15:39 2020 -0500
@@ -2730,8 +2730,8 @@
 def diffsinglehunkinline(hunklines):
     """yield tokens for a list of lines in a single hunk, with inline colors"""
     # prepare deleted, and inserted content
-    a = b''
-    b = b''
+    a = bytearray()
+    b = bytearray()
     for line in hunklines:
         if line[0:1] == b'-':
             a += line[1:]
@@ -2745,8 +2745,8 @@
             yield t
         return
     # re-split the content into words
-    al = wordsplitter.findall(a)
-    bl = wordsplitter.findall(b)
+    al = wordsplitter.findall(bytes(a))
+    bl = wordsplitter.findall(bytes(b))
     # re-arrange the words to lines since the diff algorithm is line-based
     aln = [s if s == b'\n' else s + b'\n' for s in al]
     bln = [s if s == b'\n' else s + b'\n' for s in bl]