dirstate: use `dirstate.change_files` to scope the change in `unshelve`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 15 Dec 2022 03:04:58 +0100
changeset 50109 5327ae76b740
parent 50108 1b044a63a98a
child 50110 e2b89b6d4cdd
dirstate: use `dirstate.change_files` to scope the change in `unshelve` This is the way.
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: