Mercurial > public > mercurial-scm > hg
comparison mercurial/branchmap.py @ 33663:1814ca418b30 stable
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
author | Mike Hommey <mh@glandium.org> |
---|---|
date | Thu, 10 Aug 2017 20:47:19 -0700 |
parents | 755e6532e81d |
children | abf91c4f9608 |
comparison
equal
deleted
inserted
replaced
33662:a3ce07e2dde5 | 33663:1814ca418b30 |
---|---|
404 if len(self._rbcrevs) < rbcrevidx + _rbcrecsize: | 404 if len(self._rbcrevs) < rbcrevidx + _rbcrecsize: |
405 return self._branchinfo(rev) | 405 return self._branchinfo(rev) |
406 | 406 |
407 # fast path: extract data from cache, use it if node is matching | 407 # fast path: extract data from cache, use it if node is matching |
408 reponode = changelog.node(rev)[:_rbcnodelen] | 408 reponode = changelog.node(rev)[:_rbcnodelen] |
409 cachenode, branchidx = unpack_from(_rbcrecfmt, self._rbcrevs, rbcrevidx) | 409 cachenode, branchidx = unpack_from( |
410 _rbcrecfmt, util.buffer(self._rbcrevs), rbcrevidx) | |
410 close = bool(branchidx & _rbccloseflag) | 411 close = bool(branchidx & _rbccloseflag) |
411 if close: | 412 if close: |
412 branchidx &= _rbcbranchidxmask | 413 branchidx &= _rbcbranchidxmask |
413 if cachenode == '\0\0\0\0': | 414 if cachenode == '\0\0\0\0': |
414 pass | 415 pass |