# HG changeset patch # User Pierre-Yves David # Date 2023-10-10 09:30:07 # Node ID 8c614fa16330a94e5d8f111be253a720d52ad8be # Parent 7c2dc75cdc0f5e1004975fc62b2e0cbebf9e1d0f revlog: remove legacy usage of `_srdensitythreshold` All core code is now getting the setting from the DataConfig object. diff --git a/mercurial/revlogutils/deltas.py b/mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py +++ b/mercurial/revlogutils/deltas.py @@ -50,7 +50,6 @@ class _testrevlog: 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 @@ def slicechunk(revlog, revs, targetsize= 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 @@ def slicechunk(revlog, revs, targetsize= 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