localrepo: introduce a `_refreshchangelog` method
See next changeset for usage and documentation for details.
--- 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