# HG changeset patch # User Pierre-Yves David # Date 2022-12-13 14:01:59 # Node ID 6cdcab3ae3fa597c4c7eaf9de1853cdac3daa2f2 # Parent 46883d91e2b0107ca11074e1faec5b3385c8f25a dirstate: use `dirstate.change_files` to scope the change in `revert` This is the way. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -3392,7 +3392,7 @@ def revert(ui, repo, ctx, *pats, **opts) names = {} uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True) - with repo.wlock(): + with repo.wlock(), repo.dirstate.changing_files(repo): ## filling of the `names` mapping # walk dirstate to fill `names`