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.
--- 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)