changeset 51063:533d6943f6a3

revlog: remove legacy usage of `_srmingapsize` All core code is now getting the setting from the DataConfig object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 11:33:33 +0200
parents 8c614fa16330
children 81f3877372c3
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Tue Oct 10 11:30:07 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 10 11:33:33 2023 +0200
@@ -50,7 +50,6 @@
         from .. import revlog
 
         self._data = data
-        self._srmingapsize = mingap
         self.data_config = revlog.DataConfig()
         self.data_config.sr_density_threshold = density
         self.data_config.sr_min_gap_size = mingap
@@ -91,11 +90,11 @@
 
     The initial chunk is sliced until the overall density (payload/chunks-span
     ratio) is above `revlog.data_config.sr_density_threshold`. No gap smaller
-    than `revlog._srmingapsize` is skipped.
+    than `revlog.data_config.sr_min_gap_size` is skipped.
 
     If `targetsize` is set, no chunk larger than `targetsize` will be yield.
     For consistency with other slicing choice, this limit won't go lower than
-    `revlog._srmingapsize`.
+    `revlog.data_config.sr_min_gap_size`.
 
     If individual revisions chunk are larger than this limit, they will still
     be raised individually.
@@ -144,14 +143,16 @@
     [[-1], [13], [15]]
     """
     if targetsize is not None:
-        targetsize = max(targetsize, revlog._srmingapsize)
+        targetsize = max(targetsize, revlog.data_config.sr_min_gap_size)
     # targetsize should not be specified when evaluating delta candidates:
     # * targetsize is used to ensure we stay within specification when reading,
     densityslicing = getattr(revlog.index, 'slicechunktodensity', None)
     if densityslicing is None:
         densityslicing = lambda x, y, z: _slicechunktodensity(revlog, x, y, z)
     for chunk in densityslicing(
-        revs, revlog.data_config.sr_density_threshold, revlog._srmingapsize
+        revs,
+        revlog.data_config.sr_density_threshold,
+        revlog.data_config.sr_min_gap_size,
     ):
         for subchunk in _slicechunktosize(revlog, chunk, targetsize):
             yield subchunk