dirstate: use `dirstate.change_files` to scope the change in `addremove`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 13 Dec 2022 15:07:32 +0100
changeset 50031 b979cdde99e6
parent 50030 5deac4eaa7d1
child 50032 06619266679d
dirstate: use `dirstate.change_files` to scope the change in `addremove` This is the way.
mercurial/commands.py
--- a/mercurial/commands.py	Tue Dec 13 12:57:38 2022 +0100
+++ b/mercurial/commands.py	Tue Dec 13 15:07:32 2022 +0100
@@ -331,7 +331,7 @@
     opts = pycompat.byteskwargs(opts)
     if not opts.get(b'similarity'):
         opts[b'similarity'] = b'100'
-    with repo.wlock():
+    with repo.wlock(), repo.dirstate.changing_files(repo):
         matcher = scmutil.match(repo[None], pats, opts)
         relative = scmutil.anypats(pats, opts)
         uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative)