changeset 51042:027bc364524b

revlog: skip opener options to pass mmap_index_threshold value We can directly set the option in the config object now.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 10:03:50 +0200
parents 683b96c416d8
children 8ed03f773eac
files mercurial/localrepo.py mercurial/revlog.py
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Oct 10 10:03:42 2023 +0200
+++ b/mercurial/localrepo.py	Tue Oct 10 10:03:50 2023 +0200
@@ -1118,7 +1118,7 @@
 
     mmapindexthreshold = ui.configbytes(b'experimental', b'mmapindexthreshold')
     if mmapindexthreshold is not None:
-        options[b'mmapindexthreshold'] = mmapindexthreshold
+        data_config.mmap_index_threshold = mmapindexthreshold
 
     withsparseread = ui.configbool(b'experimental', b'sparse-read')
     srdensitythres = float(
--- a/mercurial/revlog.py	Tue Oct 10 10:03:42 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 10:03:50 2023 +0200
@@ -610,7 +610,6 @@
         * force_nodemap:
             force the usage of a "development" version of the nodemap code
         """
-        mmapindexthreshold = None
         opts = self.opener.options
 
         if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
@@ -628,9 +627,9 @@
         else:
             new_header = REVLOG_DEFAULT_VERSION
 
-        if self._mmaplargeindex and b'mmapindexthreshold' in opts:
-            mmapindexthreshold = opts[b'mmapindexthreshold']
-            self.data_config.mmap_index_threshold = mmapindexthreshold
+        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: