doctest: add a `issnapshot` method to _testrevlog
We'll need it soon.
--- 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.