revlog: remove legacy usage of `_censorable`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2023 11:04:07 +0200
changeset 51050 0d33f4b0c4cb
parent 51049 3977068c638c
child 51051 21ef03239f43
revlog: remove legacy usage of `_censorable` All core code is now getting the setting from the FeatureConfig object.
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Oct 10 11:02:24 2023 +0200
+++ b/mercurial/revlog.py	Tue Oct 10 11:04:07 2023 +0200
@@ -2304,7 +2304,9 @@
                     % (self.display_id, pycompat.bytestr(revornode))
                 )
         except error.RevlogError:
-            if self._censorable and storageutil.iscensoredtext(text):
+            if self.feature_config.censorable and storageutil.iscensoredtext(
+                text
+            ):
                 raise error.CensoredNodeError(self.display_id, node, text)
             raise
 
@@ -3114,14 +3116,14 @@
 
     def iscensored(self, rev):
         """Check if a file revision is censored."""
-        if not self._censorable:
+        if not self.feature_config.censorable:
             return False
 
         return self.flags(rev) & REVIDX_ISCENSORED
 
     def _peek_iscensored(self, baserev, delta):
         """Quickly check if a delta produces a censored revision."""
-        if not self._censorable:
+        if not self.feature_config.censorable:
             return False
 
         return storageutil.deltaiscensored(delta, baserev, self.rawsize)