store: introduce boolean property for revlog type
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 15 May 2023 22:09:15 +0200
changeset 50497 66c556968222
parent 50496 e50d1fe7ebb4
child 50498 1b776f25302f
store: introduce boolean property for revlog type This will avoid exposing implementation details to more generic code.
mercurial/store.py
--- a/mercurial/store.py	Mon May 15 09:03:15 2023 +0200
+++ b/mercurial/store.py	Mon May 15 22:09:15 2023 +0200
@@ -521,6 +521,18 @@
         assert b'.i' in details, (path_prefix, details)
         self._details = details
 
+    @property
+    def is_changelog(self):
+        return self.revlog_type & FILEFLAGS_CHANGELOG
+
+    @property
+    def is_manifestlog(self):
+        return self.revlog_type & FILEFLAGS_MANIFESTLOG
+
+    @property
+    def is_filelog(self):
+        return self.revlog_type & FILEFLAGS_FILELOG
+
     def main_file_path(self):
         """unencoded path of the main revlog file"""
         return self._path_prefix + b'.i'