perf: use `setup` function in `perfdirstatewrite`
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.
--- a/contrib/perf.py Tue Oct 08 01:49:34 2019 -0400
+++ b/contrib/perf.py Tue Oct 08 02:19:04 2019 -0400
@@ -1192,11 +1192,13 @@
ds = repo.dirstate
b"a" in ds
+ def setup():
+ ds._dirty = True
+
def d():
- ds._dirty = True
ds.write(repo.currenttransaction())
- timer(d)
+ timer(d, setup=setup)
fm.end()