Index: mercurial/context.py =================================================================== --- mercurial/context.py +++ mercurial/context.py @@ -1980,6 +1980,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): @@ -1995,6 +1997,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()