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

login
register
mail settings
Submitter phabricator
Date Aug. 6, 2019, 5:10 p.m.
Message ID <3ad3fdae0f594368ad322856d4008b26@localhost.localdomain>
Download mbox | patch
Permalink /patch/41186/
State Not Applicable
Headers show

Comments

phabricator - Aug. 6, 2019, 5:10 p.m.
navaneeth.suresh updated this revision to Diff 16146.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6708?vs=16141&id=16146

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6708/new/

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

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

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers, pulkit
Cc: pulkit, 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
@@ -1250,6 +1251,10 @@ 
   record this change to 'd'?
   (enter ? for help) [Ynesfdaq?] y
   
+
+  $ hg status -v
+  A c
+  A d
   $ ls
   b
   c
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1002,11 +1002,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: