revlog: skip opener options to pass sparse_revlog value
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 10:03:58 +0200
changeset 51043 8ed03f773eac
parent 51042 027bc364524b
child 51044 e2941c398f10
revlog: skip opener options to pass sparse_revlog value We can directly set the option in the config object now.
mercurial/localrepo.py
mercurial/revlog.py
tests/test-revlog-raw.py
--- a/mercurial/localrepo.py	Tue Oct 10 10:03:50 2023 +0200
+++ b/mercurial/localrepo.py	Tue Oct 10 10:03:58 2023 +0200
@@ -1130,7 +1130,7 @@
     options[b'sparse-read-min-gap-size'] = srmingapsize
 
     sparserevlog = requirementsmod.SPARSEREVLOG_REQUIREMENT in requirements
-    options[b'sparse-revlog'] = sparserevlog
+    delta_config.sparse_revlog = sparserevlog
     if sparserevlog:
         options[b'generaldelta'] = True
 
--- a/mercurial/revlog.py	Tue Oct 10 10:03:50 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 10:03:58 2023 +0200
@@ -630,8 +630,6 @@
         mmapindexthreshold = None
         if self._mmaplargeindex:
             mmapindexthreshold = self.data_config.mmap_index_threshold
-        if b'sparse-revlog' in opts:
-            self.delta_config.sparse_revlog = bool(opts[b'sparse-revlog'])
         if self.delta_config.sparse_revlog:
             # sparse-revlog forces sparse-read
             self.data_config.with_sparse_read = True
--- a/tests/test-revlog-raw.py	Tue Oct 10 10:03:50 2023 +0200
+++ b/tests/test-revlog-raw.py	Tue Oct 10 10:03:58 2023 +0200
@@ -50,7 +50,7 @@
 tvfs.options = {
     b'generaldelta': True,
     b'revlogv1': True,
-    b'sparse-revlog': True,
+    b'delta-config': revlog.DeltaConfig(sparse_revlog=True),
 }