--- 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)