keyword: wrap dirstate mutation in `changing_files` context
This is the way.
--- a/hgext/keyword.py Tue Feb 21 23:10:02 2023 +0100
+++ b/hgext/keyword.py Wed Feb 22 03:34:48 2023 +0100
@@ -437,12 +437,11 @@
if len(wctx.parents()) > 1:
raise error.Abort(_(b'outstanding uncommitted merge'))
kwt = getattr(repo, '_keywordkwt', None)
- with repo.wlock():
+ with repo.wlock(), repo.dirstate.changing_files(repo):
status = _status(ui, repo, wctx, kwt, *pats, **opts)
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(