revlog: create the revlog object at the repository level
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 10:02:21 +0200
changeset 51036 133f5a54ed9d
parent 51035 177e7d6bf875
child 51037 774c00348f9f
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.
mercurial/localrepo.py
mercurial/revlog.py
--- 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