changeset 51062:8c614fa16330

revlog: remove legacy usage of `_srdensitythreshold` 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:30:07 +0200
parents 7c2dc75cdc0f
children 533d6943f6a3
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Tue Oct 10 11:29:19 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 10 11:30:07 2023 +0200
@@ -50,7 +50,6 @@
         from .. import revlog
 
         self._data = data
-        self._srdensitythreshold = density
         self._srmingapsize = mingap
         self.data_config = revlog.DataConfig()
         self.data_config.sr_density_threshold = density
@@ -91,8 +90,8 @@
     Assume that revs are sorted.
 
     The initial chunk is sliced until the overall density (payload/chunks-span
-    ratio) is above `revlog._srdensitythreshold`. No gap smaller than
-    `revlog._srmingapsize` is skipped.
+    ratio) is above `revlog.data_config.sr_density_threshold`. No gap smaller
+    than `revlog._srmingapsize` 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
@@ -152,7 +151,7 @@
     if densityslicing is None:
         densityslicing = lambda x, y, z: _slicechunktodensity(revlog, x, y, z)
     for chunk in densityslicing(
-        revs, revlog._srdensitythreshold, revlog._srmingapsize
+        revs, revlog.data_config.sr_density_threshold, revlog._srmingapsize
     ):
         for subchunk in _slicechunktosize(revlog, chunk, targetsize):
             yield subchunk