# HG changeset patch # User Mike Hommey # Date 2017-08-11 03:47:19 # Node ID 1814ca418b3043c4c724dbd39a6c94825adbe549 # Parent a3ce07e2dde5737644dd719806b1e52fb1cc1004 branchmap: revert c34532365b38 for Python 2.7 compatibility Old versions of python 2.7 don't like that the second argument to struct.unpack_from is a bytearray, so the change removing the util.buffer around that argument in branchmap broke running on older versions of python 2.7. Differential Revision: https://phab.mercurial-scm.org/D330 diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -406,7 +406,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