[PATCH 2 of 6] manifest: implement clearcaches()

Gregory Szorc gregory.szorc at gmail.com
Sun Dec 20 22:04:10 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1450668706 28800
#      Sun Dec 20 19:31:46 2015 -0800
# Node ID 795c9f3f2a6b917abe040303390f31cca3a4984d
# Parent  888293905f3c109d110f45f123bea3273c5ca6a9
manifest: implement clearcaches()

The manifest implements its own caches in addition to revlog's. Extend
the base clearcaches() to wipe these as well.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1030,8 +1030,13 @@ class manifest(revlog.revlog):
             n = m1.node()
         elif text == m2.dirtext(self._usemanifestv2):
             n = m2.node()
         else:
             n = self.addrevision(text, transaction, link, m1.node(), m2.node())
         # Save nodeid so parent manifest can calculate its nodeid
         m.setnode(n)
         return n
+
+    def clearcaches(self):
+        super(manifest, self).clearcaches()
+        self._mancache.clear()
+        self._dirlogcache = {'': self}


More information about the Mercurial-devel mailing list