revlog: remove legacy usage of `_maxchainlen`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 11:05:54 +0200
changeset 51052 e80e2d614c9d
parent 51051 21ef03239f43
child 51053 96f521df2508
revlog: remove legacy usage of `_maxchainlen` All core code is now getting the setting from the DeltaConfig object.
mercurial/revlogutils/deltas.py
--- 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