Patchwork [03,of,10,V2] manifest: move clearcaches to manifestlog

login
register
mail settings
Submitter Durham Goode
Date Nov. 11, 2016, 9:26 a.m.
Message ID <de7d1c4736023a887e97.1478856396@dev111.prn1.facebook.com>
Download mbox | patch
Permalink /patch/17494/
State Accepted
Headers show

Comments

Durham Goode - Nov. 11, 2016, 9:26 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1478772799 28800
#      Thu Nov 10 02:13:19 2016 -0800
# Node ID de7d1c4736023a887e97828fac8e47004b117050
# Parent  72b6741828a215f4608402025ab9f1938a47fd90
manifest: move clearcaches to manifestlog

This is part of removing all functionality from manifest.manifest so we can
delete the class entirely.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -566,7 +566,7 @@  def perfmanifest(ui, repo, rev, **opts):
     ctx = scmutil.revsingle(repo, rev, rev)
     t = ctx.manifestnode()
     def d():
-        repo.manifest.clearcaches()
+        repo.manifestlog.clearcaches()
         repo.manifestlog[t].read()
     timer(d)
     fm.end()
diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1322,6 +1322,10 @@  class manifestlog(object):
             mancache[node] = m
         return m
 
+    def clearcaches(self):
+        self._dirmancache.clear()
+        self._revlog.clearcaches()
+
 class memmanifestctx(object):
     def __init__(self, repo):
         self._repo = repo
@@ -1593,7 +1597,3 @@  class manifest(manifestrevlog):
             self._dirlogcache[dir] = manifest(self.opener, dir,
                                               self._dirlogcache)
         return self._dirlogcache[dir]
-
-    def clearcaches(self):
-        super(manifest, self).clearcaches()
-        self._mancache.clear()