contrib-perf: use `running_status` in `perf::status`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 20 Feb 2023 14:55:16 +0100
changeset 50143 ec3631290eb7
parent 50142 308aff0243ae
child 50144 c6df5349183b
contrib-perf: use `running_status` in `perf::status` This is the way.
contrib/perf.py
--- a/contrib/perf.py	Mon Feb 20 17:16:52 2023 +0100
+++ b/contrib/perf.py	Mon Feb 20 14:55:16 2023 +0100
@@ -815,7 +815,12 @@
             )
             sum(map(bool, s))
 
-        timer(status_dirstate)
+        if util.safehasattr(dirstate, 'running_status'):
+            with dirstate.running_status(repo):
+                timer(status_dirstate)
+                dirstate.invalidate()
+        else:
+            timer(status_dirstate)
     else:
         timer(lambda: sum(map(len, repo.status(unknown=opts[b'unknown']))))
     fm.end()