dirstate: explicitly write the dirstate after `debugrebuilddirstate`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 14 Feb 2023 22:26:23 +0100
changeset 49999 637d46c5b1fa
parent 49998 44528f4a4d53
child 50000 1f28172cfce9
dirstate: explicitly write the dirstate after `debugrebuilddirstate` I am working on making the dirstate write patterns more predictable. This patch is part of a small series of similar patches that adds a explicit dirstate write in a handful of location where the dirstate is updated "a bit in a strange way". With this explicit write, we are no longer relying on implicite write of the dirstate on `wlock` release. This make the world a better place.
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Mon Feb 13 22:53:54 2023 +0100
+++ b/mercurial/debugcommands.py	Tue Feb 14 22:26:23 2023 +0100
@@ -3140,6 +3140,7 @@
             changedfiles = manifestonly | dsnotadded
 
         dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
+        dirstate.write(repo.currenttransaction())
 
 
 @command(