diff mercurial/changelog.py @ 51104:1c0f3994d733

changelog-delay: move "delayed" check to a more official API To avoid reaching inside the inner object in the future, we needs some official API. We put one of such API early to reduce the size of the final diff.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 26 Oct 2023 03:41:58 +0200
parents 222b89224397
children d83d788590a8
line wrap: on
line diff
--- a/mercurial/changelog.py	Thu Oct 26 03:29:46 2023 +0200
+++ b/mercurial/changelog.py	Thu Oct 26 03:41:58 2023 +0200
@@ -374,13 +374,17 @@
         self._filteredrevs_hashcache = {}
 
     def _write_docket(self, tr):
-        if not self._delayed:
+        if not self.is_delaying:
             super(changelog, self)._write_docket(tr)
 
+    @property
+    def is_delaying(self):
+        return self._delayed
+
     def delayupdate(self, tr):
         """delay visibility of index updates to other readers"""
         assert not self._inner.is_open
-        if self._docket is None and not self._delayed:
+        if self._docket is None and not self.is_delaying:
             if len(self) == 0:
                 self._divert = True
                 if self._realopener.exists(self._indexfile + b'.a'):
@@ -456,7 +460,7 @@
         return False
 
     def _enforceinlinesize(self, tr, side_write=True):
-        if not self._delayed:
+        if not self.is_delaying:
             revlog.revlog._enforceinlinesize(self, tr, side_write=side_write)
 
     def read(self, nodeorrev):