Mercurial > public > mercurial-scm > hg
diff mercurial/revlog.py @ 51099:594f912818ab
changelog-delay: adds some check around delaying and diverting write
Theses assert shows we never call delay or divert if the revlog hold file handle
on the revlog's file.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 20 Oct 2023 12:13:33 +0200 |
parents | 045b5f745f93 |
children | af96fbb8f739 |
line wrap: on
line diff
--- a/mercurial/revlog.py Wed Oct 25 23:14:20 2023 +0200 +++ b/mercurial/revlog.py Fri Oct 20 12:13:33 2023 +0200 @@ -620,6 +620,13 @@ """True is a writing context is open""" return self._writinghandles is not None + @property + def is_open(self): + """True if any file handle is being held + + Used for assert and debug in the python code""" + return self._segmentfile.is_open or self._segmentfile_sidedata.is_open + @contextlib.contextmanager def writing(self, transaction, data_end=None, sidedata_end=None): """Open the revlog files for writing