dirstate: use `dirstate.change_files` to scope the change in `forget`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 13 Dec 2022 16:27:57 +0100
changeset 50032 06619266679d
parent 50031 b979cdde99e6
child 50033 7e71d878c708
dirstate: use `dirstate.change_files` to scope the change in `forget` This is the way.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Dec 13 15:07:32 2022 +0100
+++ b/mercurial/commands.py	Tue Dec 13 16:27:57 2022 +0100
@@ -2966,7 +2966,7 @@
     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)