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()