py3: preserve chunks as an iterable of bytes
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 11 Feb 2018 16:50:45 -0800
changeset 36115 c1104fe76e69
parent 36114 83246d6920f2
child 36116 b587a889b97e
py3: preserve chunks as an iterable of bytes patch.diffstat() returns a bytes. util.chunkbuffer() expects an iterable of bytes. Feeding it a single bytes instance on Python 3 will iterate the characters as integers. This blows up util.chunkbuffer. Differential Revision: https://phab.mercurial-scm.org/D2162
mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py	Sun Feb 11 16:40:02 2018 -0800
+++ b/mercurial/logcmdutil.py	Sun Feb 11 16:50:45 2018 -0800
@@ -81,7 +81,7 @@
     if fp is not None or ui.canwritewithoutlabels():
         out = fp or ui
         if stat:
-            chunks = patch.diffstat(util.iterlines(chunks), width=width)
+            chunks = [patch.diffstat(util.iterlines(chunks), width=width)]
         for chunk in util.filechunkiter(util.chunkbuffer(chunks)):
             out.write(chunk)
     else: