mercurial/shelve.py
changeset 50053 5327ae76b740
parent 50052 1b044a63a98a
child 50054 e2b89b6d4cdd
--- 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: