# HG changeset patch # User Boris Feld # Date 1542951148 -3600 # Node ID e4ea63855d5a014f67abcf6c9d20ddcb21fe03dd # Parent 30f443d34a7d34f168c8159273cbcd56d8cedc8d perf: introduce a function to fully "unload" a changelog The function remove various attributes and caches related to changelog. This is getting a common requirement. diff -r 30f443d34a7d -r e4ea63855d5a contrib/perf.py --- a/contrib/perf.py Fri Nov 23 01:32:57 2018 +0100 +++ b/contrib/perf.py Fri Nov 23 06:32:28 2018 +0100 @@ -465,6 +465,12 @@ delattr(obj, attrname) obj._filecache.pop(attrname, None) +def clearchangelog(repo): + if repo is not repo.unfiltered(): + object.__setattr__(repo, r'_clcachekey', None) + object.__setattr__(repo, r'_clcache', None) + clearfilecache(repo.unfiltered(), 'changelog') + # perf commands @command(b'perfwalk', formatteropts)