revlog: use the new Config classes in _testrevlog
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 18:02:20 +0200
changeset 51045 127656e0b97b
parent 51044 e2941c398f10
child 51046 f636103c4d67
revlog: use the new Config classes in _testrevlog the mock object need to follow the new interface. We allow ourself a small hacky import since this is testing code. The legacy attribute are still here because some code still use them. We will drop them when this code is updated.
mercurial/revlogutils/deltas.py
--- a/mercurial/revlogutils/deltas.py	Tue Oct 10 10:04:06 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 10 18:02:20 2023 +0200
@@ -47,9 +47,16 @@
 
     def __init__(self, data, density=0.5, mingap=0, snapshot=()):
         """data is an list of revision payload boundaries"""
+        from .. import revlog
+
         self._data = data
         self._srdensitythreshold = density
         self._srmingapsize = mingap
+        self.data_config = revlog.DataConfig()
+        self.data_config.sr_density_threshold = density
+        self.data_config.sr_min_gap_size = mingap
+        self.delta_config = revlog.DeltaConfig()
+        self.feature_config = revlog.FeatureConfig()
         self._snapshot = set(snapshot)
         self.index = None