# HG changeset patch # User Pierre-Yves David # Date 1670940452 -3600 # Node ID b979cdde99e672b383c72b65178560799260f233 # Parent 5deac4eaa7d17420cac9bd1ab2c02218844be554 dirstate: use `dirstate.change_files` to scope the change in `addremove` This is the way. diff -r 5deac4eaa7d1 -r b979cdde99e6 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)