shelve: adjust what happens in some `changing_parents` context
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 15 Dec 2022 06:22:23 +0100
changeset 50052 1b044a63a98a
parent 50051 9409f2946f16
child 50053 5327ae76b740
shelve: adjust what happens in some `changing_parents` context It seems like the rest is more about changing tracked_files, so we let start with moving them out of the `changing_parents` contexts.
mercurial/shelve.py
--- a/mercurial/shelve.py	Mon Feb 13 23:29:30 2023 +0100
+++ b/mercurial/shelve.py	Thu Dec 15 06:22:23 2022 +0100
@@ -871,9 +871,9 @@
         with repo.ui.configoverride(overrides, b'unshelve'):
             with repo.dirstate.changing_parents(repo):
                 repo.setparents(state.parents[0], repo.nullid)
-                newnode, ispartialunshelve = _createunshelvectx(
-                    ui, repo, shelvectx, basename, interactive, opts
-                )
+            newnode, ispartialunshelve = _createunshelvectx(
+                ui, repo, shelvectx, basename, interactive, opts
+            )
 
         if newnode is None:
             shelvectx = state.pendingctx
@@ -1070,9 +1070,9 @@
 
         with repo.dirstate.changing_parents(repo):
             repo.setparents(tmpwctx.node(), repo.nullid)
-            newnode, ispartialunshelve = _createunshelvectx(
-                ui, repo, shelvectx, basename, interactive, opts
-            )
+        newnode, ispartialunshelve = _createunshelvectx(
+            ui, repo, shelvectx, basename, interactive, opts
+        )
 
         if newnode is None:
             shelvectx = tmpwctx