changeset 51036:133f5a54ed9d

revlog: create the revlog object at the repository level There is currently no value set in it, but we will be able to start centralise config parsing at the repository level.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 10:02:21 +0200
parents 177e7d6bf875
children 774c00348f9f
files mercurial/localrepo.py mercurial/revlog.py
diffstat 2 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Oct 10 10:02:13 2023 +0200
+++ b/mercurial/localrepo.py	Tue Oct 10 10:02:21 2023 +0200
@@ -1068,6 +1068,10 @@
     options = {}
     options[b'flagprocessors'] = {}
 
+    feature_config = options[b'feature-config'] = revlog.FeatureConfig()
+    data_config = options[b'data-config'] = revlog.DataConfig()
+    delta_config = options[b'delta-config'] = revlog.DeltaConfig()
+
     if requirementsmod.REVLOGV1_REQUIREMENT in requirements:
         options[b'revlogv1'] = True
     if requirementsmod.REVLOGV2_REQUIREMENT in requirements:
--- a/mercurial/revlog.py	Tue Oct 10 10:02:13 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 10:02:21 2023 +0200
@@ -444,15 +444,22 @@
         assert target[0] in ALL_KINDS
         assert len(target) == 2
         self.target = target
-        self.feature_config = FeatureConfig(
-            censorable=censorable,
-            canonical_parent_order=canonical_parent_order,
-        )
-        self.data_config = DataConfig(
-            check_ambig=checkambig,
-            mmap_large_index=mmaplargeindex,
-        )
-        self.delta_config = DeltaConfig()
+        if b'feature-config' in self.opener.options:
+            self.feature_config = self.opener.options[b'feature-config'].copy()
+        else:
+            self.feature_config = FeatureConfig()
+        self.feature_config.censorable = censorable
+        self.feature_config.canonical_parent_order = canonical_parent_order
+        if b'data-config' in self.opener.options:
+            self.data_config = self.opener.options[b'data-config'].copy()
+        else:
+            self.data_config = DataConfig()
+        self.data_config.check_ambig = checkambig
+        self.data_config.mmap_large_index = mmaplargeindex
+        if b'delta-config' in self.opener.options:
+            self.delta_config = self.opener.options[b'delta-config'].copy()
+        else:
+            self.delta_config = DeltaConfig()
 
         # 3-tuple of (node, rev, text) for a raw revision.
         self._revisioncache = None