# HG changeset patch # User Pierre-Yves David # Date 2019-10-08 05:57:10 # Node ID 436a6a31df38caac6ca72350b282fad9afc27250 # Parent ce315b1fc9a7ef8d86fa4069984e6697a4a86ab9 perf: use `setup` function in `perfdirstate` The command seems to pre-date the introduction of the `setup` support in timer. We move the line that is obviously about benchmark setup in such `setup` function. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -1112,11 +1112,13 @@ def perfdirstate(ui, repo, **opts): timer, fm = gettimer(ui, opts) b"a" in repo.dirstate + def setup(): + repo.dirstate.invalidate() + def d(): - repo.dirstate.invalidate() b"a" in repo.dirstate - timer(d) + timer(d, setup=setup) fm.end()