revlog: remove legacy usage of `_sparserevlog`
All core code is now getting the setting from the DeltaConfig object.
--- a/mercurial/revlog.py Tue Oct 10 11:24:37 2023 +0200
+++ b/mercurial/revlog.py Tue Oct 10 11:27:39 2023 +0200
@@ -2077,7 +2077,7 @@
def issnapshot(self, rev):
"""tells whether rev is a snapshot"""
- if not self._sparserevlog:
+ if not self.delta_config.sparse_revlog:
return self.deltaparent(rev) == nullrev
elif hasattr(self.index, 'issnapshot'):
# directly assign the method to cache the testing and access
--- a/mercurial/revlogutils/deltas.py Tue Oct 10 11:24:37 2023 +0200
+++ b/mercurial/revlogutils/deltas.py Tue Oct 10 11:27:39 2023 +0200
@@ -622,7 +622,7 @@
# possible to build pathological revlog where delta pattern would lead
# to too many reads. However, they do not happen in practice at all. So
# we skip the span check entirely.
- if not revlog._sparserevlog and maxdist < deltainfo.distance:
+ if not revlog.delta_config.sparse_revlog and maxdist < deltainfo.distance:
return False
# Bad delta from new delta size:
@@ -715,7 +715,7 @@
deltalength = revlog.length
deltaparent = revlog.deltaparent
- sparse = revlog._sparserevlog
+ sparse = revlog.delta_config.sparse_revlog
good = None
deltas_limit = textlen * LIMIT_DELTA2TEXT
@@ -875,7 +875,7 @@
break
# If sparse revlog is enabled, we can try to refine the available deltas
- if not revlog._sparserevlog:
+ if not revlog.delta_config.sparse_revlog:
yield None
return
@@ -916,7 +916,7 @@
# Why search for delta base if we cannot use a delta base ?
assert revlog.delta_config.general_delta
# also see issue6056
- sparse = revlog._sparserevlog
+ sparse = revlog.delta_config.sparse_revlog
curr = len(revlog)
prev = curr - 1
deltachain = lambda rev: revlog._deltachain(rev)[0]
@@ -1158,9 +1158,9 @@
raise error.ProgrammingError(msg)
deltabase = chainbase
snapshotdepth = None
- if revlog._sparserevlog and deltabase == nullrev:
+ if revlog.delta_config.sparse_revlog and deltabase == nullrev:
snapshotdepth = 0
- elif revlog._sparserevlog and revlog.issnapshot(deltabase):
+ elif revlog.delta_config.sparse_revlog and revlog.issnapshot(deltabase):
# A delta chain should always be one full snapshot,
# zero or more semi-snapshots, and zero or more deltas
p1, p2 = revlog.rev(revinfo.p1), revlog.rev(revinfo.p2)