revlog: remove legacy usage of `_lazydeltabase`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 12:03:02 +0200
changeset 51067 26dcdbe15024
parent 51066 b79c73a7afce
child 51068 41c73325af52
revlog: remove legacy usage of `_lazydeltabase` All core code is now getting the setting from the DeltaConfig object.
contrib/perf.py
mercurial/revlogutils/deltas.py
--- a/contrib/perf.py	Tue Oct 10 11:36:55 2023 +0200
+++ b/contrib/perf.py	Tue Oct 10 12:03:02 2023 +0200
@@ -3549,7 +3549,10 @@
     timings = []
     tr = _faketr()
     with _temprevlog(ui, orig, startrev) as dest:
-        dest._lazydeltabase = lazydeltabase
+        if hasattr(dest, "delta_config"):
+            dest.delta_config.lazy_delta_base = lazydeltabase
+        else:
+            dest._lazydeltabase = lazydeltabase
         revs = list(orig.revs(startrev, stoprev))
         total = len(revs)
         topic = 'adding'
--- a/mercurial/revlogutils/deltas.py	Tue Oct 10 11:36:55 2023 +0200
+++ b/mercurial/revlogutils/deltas.py	Tue Oct 10 12:03:02 2023 +0200
@@ -1177,7 +1177,7 @@
                 and self.revlog.length(currentbase) == 0
             ):
                 currentbase = self.revlog.deltaparent(currentbase)
-            if self.revlog._lazydelta and currentbase == base:
+            if self.revlog.delta_config.lazy_delta and currentbase == base:
                 delta = revinfo.cachedelta[1]
         if delta is None:
             delta = self._builddeltadiff(base, revinfo)