mercurial/revlogutils/randomaccessfile.py
changeset 51099 594f912818ab
parent 51024 3314c41c3759
child 51100 222b89224397
--- a/mercurial/revlogutils/randomaccessfile.py	Wed Oct 25 23:14:20 2023 +0200
+++ b/mercurial/revlogutils/randomaccessfile.py	Fri Oct 20 12:13:33 2023 +0200
@@ -50,6 +50,15 @@
         self._cached_chunk = b''
         self._cached_chunk_position = 0
 
+    @property
+    def is_open(self):
+        """True if any file handle is being held
+
+        Used for assert and debug in the python code"""
+        return (
+            self.reading_handle is not None or self.writing_handle is not None
+        )
+
     def _open(self, mode=b'r'):
         """Return a file object"""
         return self.opener(self.filename, mode=mode)