Patchwork [09,of,10,py3] revlog: use bytes() to ensure text from _chunks is a reasonable type

login
register
mail settings
Submitter Augie Fackler
Date March 12, 2017, 6:57 p.m.
Message ID <e8cceea7006f5b63cc17.1489345069@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19209/
State Accepted
Headers show

Comments

Augie Fackler - March 12, 2017, 6:57 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489303958 14400
#      Sun Mar 12 03:32:38 2017 -0400
# Node ID e8cceea7006f5b63cc17444d2552b54c1b97f33a
# Parent  4eab3adcc0793f60b863da542fe8e152e33efa9c
revlog: use bytes() to ensure text from _chunks is a reasonable type

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1277,7 +1277,7 @@  class revlog(object):
 
         bins = self._chunks(chain, df=_df)
         if text is None:
-            text = str(bins[0])
+            text = bytes(bins[0])
             bins = bins[1:]
 
         text = mdiff.patches(text, bins)