changeset 35327:777cb4497d8d

overlayworkingctx: invalidate the manifest cache when changing parents This fixes problems noticeable when rebasing several commits into one destination commit using ``--collapse``. The manifest cache needs to be cleared each time. Differential Revision: https://phab.mercurial-scm.org/D1244
author Phil Cohen <phillco@fb.com>
date Thu, 07 Dec 2017 16:07:06 -0800
parents dc9da4f4f363
children 4937db58b663
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Thu Dec 07 16:07:06 2017 -0800
+++ b/mercurial/context.py	Thu Dec 07 16:07:06 2017 -0800
@@ -1999,6 +1999,10 @@
     def setbase(self, wrappedctx):
         self._wrappedctx = wrappedctx
         self._parents = [wrappedctx]
+        # Drop old manifest cache as it is now out of date.
+        # This is necessary when, e.g., rebasing several nodes with one
+        # ``overlayworkingctx`` (e.g. with --collapse).
+        util.clearcachedproperty(self, '_manifest')
 
     def data(self, path):
         if self.isdirty(path):