diff mercurial/store.py @ 50497:66c556968222

store: introduce boolean property for revlog type This will avoid exposing implementation details to more generic code.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 22:09:15 +0200
parents e50d1fe7ebb4
children 1b776f25302f
line wrap: on
line diff
--- 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'