Patchwork [py26-fix] branchmap: fix python 2.6 by using util.buffer() instead of passing bytearray

login
register
mail settings
Submitter Augie Fackler
Date March 13, 2017, 12:15 a.m.
Message ID <df3fd1d493739948ba39.1489364113@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/19261/
State Accepted
Headers show

Comments

Augie Fackler - March 13, 2017, 12:15 a.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489362471 14400
#      Sun Mar 12 19:47:51 2017 -0400
# Node ID df3fd1d493739948ba39c85072a09c5fee06480b
# Parent  52ee1b5ac277bd5569a8d3e3ae3e11dff0543323
branchmap: fix python 2.6 by using util.buffer() instead of passing bytearray
Yuya Nishihara - March 13, 2017, 12:34 a.m.
On Sun, 12 Mar 2017 20:15:13 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1489362471 14400
> #      Sun Mar 12 19:47:51 2017 -0400
> # Node ID df3fd1d493739948ba39c85072a09c5fee06480b
> # Parent  52ee1b5ac277bd5569a8d3e3ae3e11dff0543323
> branchmap: fix python 2.6 by using util.buffer() instead of passing bytearray

Queued, thanks.

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -408,7 +408,8 @@  class revbranchcache(object):
 
         # fast path: extract data from cache, use it if node is matching
         reponode = changelog.node(rev)[:_rbcnodelen]
-        cachenode, branchidx = unpack_from(_rbcrecfmt, self._rbcrevs, rbcrevidx)
+        cachenode, branchidx = unpack_from(
+            _rbcrecfmt, util.buffer(self._rbcrevs), rbcrevidx)
         close = bool(branchidx & _rbccloseflag)
         if close:
             branchidx &= _rbcbranchidxmask