# HG changeset patch # User Pierre-Yves David # Date 1677033288 -3600 # Node ID b09a0afcb975601adfa2c997a1fad2883872df8b # Parent 03decaaf1eff76b7f0a4dc79111d91bfea10a38d keyword: wrap dirstate mutation in `changing_files` context This is the way. diff -r 03decaaf1eff -r b09a0afcb975 hgext/keyword.py --- 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(