# HG changeset patch # User Pierre-Yves David # Date 1696930207 -7200 # Node ID 8c614fa16330a94e5d8f111be253a720d52ad8be # Parent 7c2dc75cdc0f5e1004975fc62b2e0cbebf9e1d0f revlog: remove legacy usage of `_srdensitythreshold` All core code is now getting the setting from the DataConfig object. diff -r 7c2dc75cdc0f -r 8c614fa16330 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