Patchwork D6700: unshelve: clear shelvedstate and _finishunshelve() on partial unshelve

login
register
mail settings
Submitter phabricator
Date July 27, 2019, 6:56 a.m.
Message ID <differential-rev-PHID-DREV-fokgrzhq2wabp2m5tfod-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41090/
State Superseded
Headers show

Comments

phabricator - July 27, 2019, 6:56 a.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  On a partial `unshelve`, `shelvedstate` was not cleared and `_finishunshelve()`
  was not called. Ideally, these should be called on this case. This patch makes
  `shelvedstate` to delete after a successful partial `unshelve` and calls
  `_finishunshelve()` in the same case.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6700

AFFECTED FILES
  mercurial/shelve.py
  tests/test-shelve.t

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -1239,6 +1239,7 @@ 
   > y
   > EOF
   unshelving change 'default'
+  temporarily committing pending changes (restore with 'hg unshelve --abort')
   rebasing shelved changes
   diff --git a/d b/d
   new file mode 100644
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1001,11 +1001,10 @@ 
         with ui.configoverride(overrides, 'unshelve'):
             mergefiles(ui, repo, pctx, shelvectx)
         restorebranch(ui, repo, branchtorestore)
+        shelvedstate.clear(repo)
+        _finishunshelve(repo, oldtiprev, tr, activebookmark)
         if not ispartialunshelve:
             _forgetunknownfiles(repo, shelvectx, addedbefore)
-
-            shelvedstate.clear(repo)
-            _finishunshelve(repo, oldtiprev, tr, activebookmark)
             unshelvecleanup(ui, repo, basename, opts)
     finally:
         if tr: