revlog: remove legacy usage of `_srdensitythreshold`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 11:30:07 +0200
changeset 51062 8c614fa16330
parent 51061 7c2dc75cdc0f
child 51063 533d6943f6a3
revlog: remove legacy usage of `_srdensitythreshold` All core code is now getting the setting from the DataConfig object.
mercurial/revlogutils/deltas.py
--- 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