# HG changeset patch # User Gregory Szorc # Date 2015-12-21 01:48:20 # Node ID 072a675c51f20cfcc856a5353454a4d6e77f12fc # Parent c39ecb2b86b36ccd1f45d2373dd161200c5ee1a8 revlog: make clearcaches() more effective clearcaches() was added several years ago in e8d37b78acfb as part of implementing a perf command. Since revlog instances have many caches and since the spirit of this mostly unused method is to facilitate performance testing, I think it's appropriate for all the revlog's caches to get cleared when it is called. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -339,6 +339,11 @@ class revlog(object): return False def clearcaches(self): + self._cache = None + self._basecache = None + self._chunkcache = (0, '') + self._pcache = {} + try: self._nodecache.clearcaches() except AttributeError: