comparison mercurial/revlog.py @ 51106: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
comparison
equal deleted inserted replaced
51105:045b5f745f93 51106:594f912818ab
618 @property 618 @property
619 def is_writing(self): 619 def is_writing(self):
620 """True is a writing context is open""" 620 """True is a writing context is open"""
621 return self._writinghandles is not None 621 return self._writinghandles is not None
622 622
623 @property
624 def is_open(self):
625 """True if any file handle is being held
626
627 Used for assert and debug in the python code"""
628 return self._segmentfile.is_open or self._segmentfile_sidedata.is_open
629
623 @contextlib.contextmanager 630 @contextlib.contextmanager
624 def writing(self, transaction, data_end=None, sidedata_end=None): 631 def writing(self, transaction, data_end=None, sidedata_end=None):
625 """Open the revlog files for writing 632 """Open the revlog files for writing
626 633
627 Add content to a revlog should be done within such context. 634 Add content to a revlog should be done within such context.