# HG changeset patch # User Pierre-Yves David # Date 2022-12-15 02:04:58 # Node ID 5327ae76b7408e259bea8dcf61bcfe98aa69850f # Parent 1b044a63a98a9e6697de70426969bc7adcf4213d dirstate: use `dirstate.change_files` to scope the change in `unshelve` This is the way. diff --git a/mercurial/shelve.py b/mercurial/shelve.py --- a/mercurial/shelve.py +++ b/mercurial/shelve.py @@ -1218,7 +1218,8 @@ def _dounshelve(ui, repo, basename, opts restorebranch(ui, repo, branchtorestore) shelvedstate.clear(repo) _finishunshelve(repo, oldtiprev, tr, activebookmark) - _forgetunknownfiles(repo, shelvectx, addedbefore) + with repo.dirstate.changing_files(repo): + _forgetunknownfiles(repo, shelvectx, addedbefore) if not ispartialunshelve: unshelvecleanup(ui, repo, basename, opts) finally: