dirstate: explicitly write the dirstate after `eol` dirstate manipulation
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 13 Feb 2023 23:33:27 +0100
changeset 49997 981d2f132935
parent 49996 89796af68b27
child 49998 44528f4a4d53
dirstate: explicitly write the dirstate after `eol` dirstate manipulation 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.
hgext/eol.py
--- a/hgext/eol.py	Mon Feb 13 23:49:52 2023 +0100
+++ b/hgext/eol.py	Mon Feb 13 23:33:27 2023 +0100
@@ -445,6 +445,7 @@
                     # Write the cache to update mtime and cache .hgeol
                     with self.vfs(b"eol.cache", b"w") as f:
                         f.write(hgeoldata)
+                    self.dirstate.write(self.currenttransaction())
                 except errormod.LockUnavailable:
                     # If we cannot lock the repository and clear the
                     # dirstate, then a commit might not see all files