shelve: avoid setting overloading tmpwctx
authorJason R. Coombs <jaraco@jaraco.com>
Wed, 19 Oct 2022 16:14:50 -0400
changeset 49522 f599a946181d
parent 49520 eb02decdf0ab
child 49523 52dd7a43ad5c
shelve: avoid setting overloading tmpwctx
mercurial/shelve.py
--- a/mercurial/shelve.py	Mon Oct 10 14:48:39 2022 +0100
+++ b/mercurial/shelve.py	Wed Oct 19 16:14:50 2022 -0400
@@ -1177,7 +1177,6 @@
         oldtiprev = len(repo)
 
         pctx = repo[b'.']
-        tmpwctx = pctx
         # The goal is to have a commit structure like so:
         # ...-> pctx -> tmpwctx -> shelvectx
         # where tmpwctx is an optional commit with the user's pending changes
@@ -1186,7 +1185,7 @@
 
         activebookmark = _backupactivebookmark(repo)
         tmpwctx, addedbefore = _commitworkingcopychanges(
-            ui, repo, opts, tmpwctx
+            ui, repo, opts, pctx
         )
         repo, shelvectx = _unshelverestorecommit(ui, repo, tr, basename)
         _checkunshelveuntrackedproblems(ui, repo, shelvectx)