# HG changeset patch # User Pierre-Yves David # Date 2022-12-13 15:27:57 # Node ID 06619266679d489301b2c4ff8babab91959e1334 # Parent b979cdde99e672b383c72b65178560799260f233 dirstate: use `dirstate.change_files` to scope the change in `forget` This is the way. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2966,7 +2966,7 @@ def forget(ui, repo, *pats, **opts): if not pats: raise error.InputError(_(b'no files specified')) - with repo.wlock(): + with repo.wlock(), repo.dirstate.changing_files(repo): m = scmutil.match(repo[None], pats, opts) dryrun, interactive = opts.get(b'dry_run'), opts.get(b'interactive') uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)