D1244: overlayworkingctx: invalidate the manifest cache when changing parents
phillco (Phil Cohen)
phabricator at mercurial-scm.org
Fri Dec 8 01:38:28 EST 2017
phillco updated this revision to Diff 4236.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D1244?vs=4217&id=4236
REVISION DETAIL
https://phab.mercurial-scm.org/D1244
AFFECTED FILES
mercurial/context.py
CHANGE DETAILS
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1999,6 +1999,8 @@
def setbase(self, wrappedctx):
self._wrappedctx = wrappedctx
self._parents = [wrappedctx]
+ # Drop old manifest cache:
+ self._invalidate()
def data(self, path):
if self.isdirty(path):
@@ -2014,6 +2016,13 @@
else:
return self._wrappedctx[path].data()
+ def _invalidate(self):
+ # Unfortunately, this is necessary when rebasing several nodes with one
+ # ``overlayworkingctx`` (e.g. with --collapse); the manifest can change
+ # and make the cache outdated.
+ self._manifest = None
+ del self.__dict__["_manifest"]
+
@propertycache
def _manifest(self):
parents = self.parents()
To: phillco, #hg-reviewers, durin42
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list