changeset 50053:5327ae76b740

dirstate: use `dirstate.change_files` to scope the change in `unshelve` This is the way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 15 Dec 2022 03:04:58 +0100
parents 1b044a63a98a
children e2b89b6d4cdd
files mercurial/shelve.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: