# HG changeset patch # User Pierre-Yves David # Date 2023-02-13 21:53:54 # Node ID 44528f4a4d53408a2ea4642fa77befb512dab42e # Parent 981d2f132935f16f2e3a1c3c29da9c8c535ba170 dirstate: explicitly write the dirstate after `keyword` "overwrite" 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. diff --git a/hgext/keyword.py b/hgext/keyword.py --- a/hgext/keyword.py +++ b/hgext/keyword.py @@ -442,6 +442,7 @@ def _kwfwrite(ui, repo, expand, *pats, * if status.modified or status.added or status.removed or status.deleted: raise error.Abort(_(b'outstanding uncommitted changes')) kwt.overwrite(wctx, status.clean, True, expand) + repo.dirstate.write(repo.currenttransaction()) @command(