dirstate: use `dirstate.change_files` to scope the change in `unshelve`
This is the way.
--- 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: