# HG changeset patch # User Boris Feld # Date 1542117989 -3600 # Node ID 85b14f0dc3342f670fd113686e6994cc2cfc5791 # Parent a3183ca7ce8f1cad9ae27fa803f77228e9484936 doctest: add a `issnapshot` method to _testrevlog We'll need it soon. diff -r a3183ca7ce8f -r 85b14f0dc334 mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Tue Nov 13 14:41:04 2018 +0100 +++ b/mercurial/revlogutils/deltas.py Tue Nov 13 15:06:29 2018 +0100 @@ -38,11 +38,12 @@ class _testrevlog(object): """minimalist fake revlog to use in doctests""" - def __init__(self, data, density=0.5, mingap=0): + def __init__(self, data, density=0.5, mingap=0, snapshot=()): """data is an list of revision payload boundaries""" self._data = data self._srdensitythreshold = density self._srmingapsize = mingap + self._snapshot = set(snapshot) def start(self, rev): if rev == 0: @@ -58,6 +59,9 @@ def __len__(self): return len(self._data) + def issnapshot(self, rev): + return rev in self._snapshot + def slicechunk(revlog, revs, targetsize=None): """slice revs to reduce the amount of unrelated data to be read from disk.