[PATCH 7 of 8] branchmap: remove use of buffer() to support Python 2.6

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Jun 8 16:02:40 UTC 2017


At Sat, 13 May 2017 12:54:39 -0700,
Gregory Szorc wrote:
> 
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1494701888 25200
> #      Sat May 13 11:58:08 2017 -0700
> # Node ID d407296a5efc9710584087d23e4ff9293d7fb6ef
> # Parent  016157858ae7e60681163ba47dca6ba822319dbe
> branchmap: remove use of buffer() to support Python 2.6
> 
> The use of buffer() was added in 7359157b9e46 to support Python 2.6,
> which we no longer support.

For SupportedPythonVersions wiki page and release note of coming
Mercurial 4.3 :-)

This unpacking feature seems available with Python 2.7.4 (released at
2013-04-06) or later, as "fixing issue10212".

  https://hg.python.org/cpython/raw-file/v2.7.4/Misc/NEWS
  https://bugs.python.org/issue10212

I confirmed that this patch causes failure in this code path with
Python 2.7.3 at least.

> diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
> --- a/mercurial/branchmap.py
> +++ b/mercurial/branchmap.py
> @@ -406,8 +406,7 @@ 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, util.buffer(self._rbcrevs), rbcrevidx)
> +        cachenode, branchidx = unpack_from(_rbcrecfmt, self._rbcrevs, rbcrevidx)
>          close = bool(branchidx & _rbccloseflag)
>          if close:
>              branchidx &= _rbcbranchidxmask
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-- 
----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list