changeset 42182: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 95c2f951e502
children 044045dce23a
files mercurial/bundlerepo.py mercurial/localrepo.py
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Wed Jun 19 17:26:19 2019 +0200
+++ b/mercurial/bundlerepo.py	Fri Jun 21 03:50:06 2019 +0200
@@ -365,6 +365,11 @@
         self.manstart = self._cgunpacker.tell()
         return c
 
+    def _refreshchangelog(self):
+        # changelog for bundle repo are not filecache, this method is not
+        # applicable.
+        pass
+
     @localrepo.unfilteredpropertycache
     def manifestlog(self):
         self._cgunpacker.seek(self.manstart)
--- 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