# HG changeset patch # User Pierre-Yves David # Date 1697206264 -7200 # Node ID 5645524c6b62611b397ba6bff8c555aee25162bb # Parent 808f1e38cd1db72f6874295dda2009b3926186fa revlog: also migrates `revlog.upperboundcomp` to ConfigClass This was planned but overlooked when doing the rest of the migration. diff -r 808f1e38cd1d -r 5645524c6b62 mercurial/revlog.py --- a/mercurial/revlog.py Fri Oct 13 16:03:26 2023 +0200 +++ b/mercurial/revlog.py Fri Oct 13 16:11:04 2023 +0200 @@ -425,7 +425,6 @@ that test, debug, or performance measurement code might not set this to accurate value. """ - self.upperboundcomp = upperboundcomp self.radix = radix @@ -460,6 +459,7 @@ self.delta_config = self.opener.options[b'delta-config'].copy() else: self.delta_config = DeltaConfig() + self.delta_config.upper_bound_comp = upperboundcomp # 3-tuple of (node, rev, text) for a raw revision. self._revisioncache = None @@ -574,6 +574,16 @@ return self.feature_config.compression_engine @property + def upperboundcomp(self): + """temporary compatibility proxy""" + util.nouideprecwarn( + b"use revlog.delta_config.upper_bound_comp", + b"6.6", + stacklevel=2, + ) + return self.delta_config.upper_bound_comp + + @property def _compengineopts(self): """temporary compatibility proxy""" util.nouideprecwarn( diff -r 808f1e38cd1d -r 5645524c6b62 mercurial/revlogutils/deltas.py --- a/mercurial/revlogutils/deltas.py Fri Oct 13 16:03:26 2023 +0200 +++ b/mercurial/revlogutils/deltas.py Fri Oct 13 16:11:04 2023 +0200 @@ -784,8 +784,8 @@ if deltas_limit < chainsize: tested.add(rev) continue - if sparse and revlog.upperboundcomp is not None: - maxcomp = revlog.upperboundcomp + if sparse and revlog.delta_config.upper_bound_comp is not None: + maxcomp = revlog.delta_config.upper_bound_comp basenotsnap = (p1, p2, nullrev) if rev not in basenotsnap and revlog.issnapshot(rev): snapshotdepth = revlog.snapshotdepth(rev) @@ -1186,8 +1186,10 @@ msg %= len(delta) self._write_debug(msg) # snapshotdept need to be neither None nor 0 level snapshot - if revlog.upperboundcomp is not None and snapshotdepth: - lowestrealisticdeltalen = len(delta) // revlog.upperboundcomp + if revlog.delta_config.upper_bound_comp is not None and snapshotdepth: + lowestrealisticdeltalen = ( + len(delta) // revlog.delta_config.upper_bound_comp + ) snapshotlimit = revinfo.textlen >> snapshotdepth if self._debug_search: msg = b"DBG-DELTAS-SEARCH: projected-lower-size=%d\n"