# HG changeset patch # User Pierre-Yves David # Date 1524139212 -7200 # Node ID 50f1968724f040fe91352412d85287c89d092aa9 # Parent 36714eeb51d10a642f9545dfa2c6b67acfae7bcb obscache: drop compat layer for obsmarkers reading We cna now use a version with the argument we needs. diff -r 36714eeb51d1 -r 50f1968724f0 hgext3rd/evolve/obscache.py --- a/hgext3rd/evolve/obscache.py Thu Apr 19 13:40:57 2018 +0200 +++ b/hgext3rd/evolve/obscache.py Thu Apr 19 14:00:12 2018 +0200 @@ -13,7 +13,6 @@ import weakref from mercurial import ( - error, localrepo, obsolete, phases, @@ -21,8 +20,6 @@ util, ) -from mercurial.i18n import _ - from . import ( compat, exthelper, @@ -84,30 +81,6 @@ return obsstore -if obsolete._fm0readmarkers.__code__.co_argcount > 2: - # hg-4.3+ has the "offset" parameter, and _fm?readmarkers also have an - # extra "stop" parameter - # Note that _readmarkers is wrapped by @util.nogc, so its co_argcount is - # misleadingly 0. So we check _fm0readmarkers instead, which increased its - # argument count in the same changeset (5d3ba439). - _readmarkers = obsolete._readmarkers -else: - # XXX copied as is from Mercurial 4.2 and added the "offset" parameters - @util.nogc - def _readmarkers(data, offset=None): - """Read and enumerate markers from raw data""" - off = 0 - diskversion = struct.unpack('>B', data[off:off + 1])[0] - if offset is None: - off += 1 - else: - assert 1 <= offset - off = offset - if diskversion not in obsolete.formats: - raise error.Abort(_('parsing obsolete marker: unknown version %r') - % diskversion) - return diskversion, obsolete.formats[diskversion][0](data, off) - def markersfrom(obsstore, byteoffset, firstmarker): if not firstmarker: return list(obsstore) @@ -116,7 +89,7 @@ return obsstore._all[firstmarker:] else: obsdata = obsstore.svfs.tryread('obsstore') - return _readmarkers(obsdata, byteoffset)[1] + return obsolete._readmarkers(obsdata, byteoffset)[1] class dualsourcecache(object):