changeset 51057:e80e2d614c9d

revlog: remove legacy usage of `_maxchainlen` All core code is now getting the setting from the DeltaConfig object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 11:05:54 +0200
parents 21ef03239f43
children 96f521df2508
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Tue Oct 10 11:04:40 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 10 11:05:54 2023 +0200
@@ -641,7 +641,10 @@
     # Bad delta from chain length:
     #
     #   If the number of delta in the chain gets too high.
-    if revlog._maxchainlen and revlog._maxchainlen < deltainfo.chainlen:
+    if (
+        revlog.delta_config.max_chain_len
+        and revlog.delta_config.max_chain_len < deltainfo.chainlen
+    ):
         return False
 
     # bad delta from intermediate snapshot size limit
@@ -771,7 +774,10 @@
             # here too.
             chainlen, chainsize = revlog._chaininfo(rev)
             # if chain will be too long, skip base
-            if revlog._maxchainlen and chainlen >= revlog._maxchainlen:
+            if (
+                revlog.delta_config.max_chain_len
+                and chainlen >= revlog.delta_config.max_chain_len
+            ):
                 tested.add(rev)
                 continue
             # if chain already have too much data, skip base