# HG changeset patch # User Boris Feld # Date 2019-01-25 19:53:19 # Node ID ab6d1f82be32dbeef7981f3e10b84c5ea85698e0 # Parent e2e815e3c4ae9ed9dcecf846560d1d43f27afe2e perf: move cache clearing in the `setup` step of `perfheads` The cache clearing is pretty fast, but this seems more "correct". diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -539,10 +539,11 @@ def perfheads(ui, repo, **opts): opts = _byteskwargs(opts) timer, fm = gettimer(ui, opts) cl = repo.changelog + def s(): + clearcaches(cl) def d(): len(cl.headrevs()) - clearcaches(cl) - timer(d) + timer(d, setup=s) fm.end() @command(b'perftags', formatteropts+