diff mercurial/localrepo.py @ 42510:3472a3f9d785 stable

localrepo: introduce a `_refreshchangelog` method See next changeset for usage and documentation for details.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 21 Jun 2019 03:50:06 +0200
parents d532292eff22
children 044045dce23a
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Jun 19 17:26:19 2019 +0200
+++ b/mercurial/localrepo.py	Fri Jun 21 03:50:06 2019 +0200
@@ -1224,6 +1224,11 @@
     def _bookmarks(self):
         return bookmarks.bmstore(self)
 
+    def _refreshchangelog(self):
+        """make sure the in memory changelog match the on-disk one"""
+        if ('changelog' in vars(self) and self.currenttransaction() is None):
+            del self.changelog
+
     @property
     def _activebookmark(self):
         return self._bookmarks.active