From patchwork Sun Mar 12 17:59:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7,of,9,py3,v3] branchmap: don't use buffer() on Python 3 From: Augie Fackler X-Patchwork-Id: 19195 Message-Id: <46eb1834c644e675bd24.1489341555@augie-macbookair2.roam.corp.google.com> To: mercurial-devel@mercurial-scm.org Date: Sun, 12 Mar 2017 13:59:15 -0400 # HG changeset patch # User Augie Fackler # Date 1489297759 18000 # Sun Mar 12 00:49:19 2017 -0500 # Node ID 46eb1834c644e675bd246bbae254cada40c2f21b # Parent 85be2e7b95aac78211a83d71e14ff8a6901ebbd5 branchmap: don't use buffer() on Python 3 This is certainly slower than the Python 2 code, but it works, and we can revisit it later if it's a problem. diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py --- a/mercurial/branchmap.py +++ b/mercurial/branchmap.py @@ -409,7 +409,7 @@ class revbranchcache(object): # fast path: extract data from cache, use it if node is matching reponode = changelog.node(rev)[:_rbcnodelen] cachenode, branchidx = unpack( - _rbcrecfmt, buffer(self._rbcrevs, rbcrevidx, _rbcrecsize)) + _rbcrecfmt, util.buffer(self._rbcrevs, rbcrevidx, _rbcrecsize)) close = bool(branchidx & _rbccloseflag) if close: branchidx &= _rbcbranchidxmask