changeset 50008:e859f440daa9

locking: grab the wlock before touching the dirstate in `perfdirstatewrite` If we touch the dirstate, we should hold the `wlock`.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 05 Feb 2023 16:54:26 +0100
parents 2aacd560cf59
children 115510658219
files contrib/perf.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Tue Dec 13 04:22:19 2022 +0100
+++ b/contrib/perf.py	Sun Feb 05 16:54:26 2023 +0100
@@ -235,6 +235,7 @@
 
 cmdtable = {}
 
+
 # for "historical portability":
 # define parsealiases locally, because cmdutil.parsealiases has been
 # available since 1.5 (or 6252852b4332)
@@ -573,7 +574,6 @@
 
 
 def formatone(fm, timings, title=None, result=None, displayall=False):
-
     count = len(timings)
 
     fm.startitem()
@@ -1474,7 +1474,8 @@
     def d():
         ds.write(repo.currenttransaction())
 
-    timer(d, setup=setup)
+    with repo.wlock():
+        timer(d, setup=setup)
     fm.end()