Patchwork [12,of,12,py3] revlog: use bytes() instead of str() to get data from memoryview

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

Comments

Augie Fackler - March 12, 2017, 7:50 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489346822 14400
#      Sun Mar 12 15:27:02 2017 -0400
# Node ID 6c5c0c483a25af9a1a2ebdbc6acadfdd072354d6
# Parent  a7ce480c925f8f904bdbf590a4e94529956cc48f
revlog: use bytes() instead of str() to get data from memoryview

Fixes `files -v` on Python 3.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1234,7 +1234,7 @@  class revlog(object):
     def revdiff(self, rev1, rev2):
         """return or calculate a delta between two revisions"""
         if rev1 != nullrev and self.deltaparent(rev2) == rev1:
-            return str(self._chunk(rev2))
+            return bytes(self._chunk(rev2))
 
         return mdiff.textdiff(self.revision(rev1),
                               self.revision(rev2))