[PATCH 2 of 7] py3: use bytes() to cast to immutable bytes in pure.bdiff.bdiff()

Yuya Nishihara yuya at tcha.org
Sun Mar 26 07:59:45 EDT 2017


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1490512605 -32400
#      Sun Mar 26 16:16:45 2017 +0900
# Node ID 662b30cb4977b4f6fcf56e768ef1c7c5da8e8adc
# Parent  3bb6534a49672073885c64a7a75a8ef5bb26f381
py3: use bytes() to cast to immutable bytes in pure.bdiff.bdiff()

diff --git a/mercurial/pure/bdiff.py b/mercurial/pure/bdiff.py
--- a/mercurial/pure/bdiff.py
+++ b/mercurial/pure/bdiff.py
@@ -54,12 +54,9 @@ def _normalizeblocks(a, b, blocks):
     r.append(prev)
     return r
 
-def _tostring(c):
-    return str(c)
-
 def bdiff(a, b):
-    a = _tostring(a).splitlines(True)
-    b = _tostring(b).splitlines(True)
+    a = bytes(a).splitlines(True)
+    b = bytes(b).splitlines(True)
 
     if not a:
         s = "".join(b)


More information about the Mercurial-devel mailing list