# HG changeset patch # User Pierre-Yves David # Date 1671069898 -3600 # Node ID 5327ae76b7408e259bea8dcf61bcfe98aa69850f # Parent 1b044a63a98a9e6697de70426969bc7adcf4213d dirstate: use `dirstate.change_files` to scope the change in `unshelve` This is the way. diff -r 1b044a63a98a -r 5327ae76b740 mercurial/shelve.py --- a/mercurial/shelve.py Thu Dec 15 06:22:23 2022 +0100 +++ b/mercurial/shelve.py Thu Dec 15 03:04:58 2022 +0100 @@ -1218,7 +1218,8 @@ 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: