overlayworkingctx: invalidate the manifest cache when changing parents
authorPhil Cohen <phillco@fb.com>
Thu, 07 Dec 2017 16:07:06 -0800
changeset 35327 777cb4497d8d
parent 35326 dc9da4f4f363
child 35328 4937db58b663
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
mercurial/context.py
--- 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):