revlog: remove legacy usage of `_compengine`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 11:12:06 +0200
changeset 51056 f0756d0636d1
parent 51055 fa7d307e2150
child 51057 101c30938c0d
revlog: remove legacy usage of `_compengine` All core code is now getting the setting from the FeatureConfig object.
mercurial/revlog.py
mercurial/revlogutils/docket.py
--- a/mercurial/revlog.py	Wed Oct 11 00:04:23 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 11:12:06 2023 +0200
@@ -976,7 +976,7 @@
 
     @util.propertycache
     def _compressor(self):
-        engine = util.compengines[self._compengine]
+        engine = util.compengines[self.feature_config.compression_engine]
         return engine.revlogcompressor(self._compengineopts)
 
     @util.propertycache
--- a/mercurial/revlogutils/docket.py	Wed Oct 11 00:04:23 2023 +0200
+++ b/mercurial/revlogutils/docket.py	Tue Oct 10 11:12:06 2023 +0200
@@ -330,7 +330,9 @@
     rl_version = version_header & 0xFFFF
     if rl_version not in (constants.REVLOGV2, constants.CHANGELOGV2):
         return None
-    comp = util.compengines[revlog._compengine].revlogheader()
+    comp = util.compengines[
+        revlog.feature_config.compression_engine
+    ].revlogheader()
     docket = RevlogDocket(
         revlog,
         version_header=version_header,