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

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

Comments

phabricator - Aug. 6, 2019, 5:22 p.m.
Closed by commit rHG6957f7b93e03: unshelve: clear shelvedstate and _finishunshelve() on partial unshelve (authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6708?vs=16146&id=16147#toc

REPOSITORY
  rHG Mercurial

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

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
@@ -1360,19 +1365,19 @@ 
 
 #if stripbased
   $ hg log -r 3:: -G
-  @  changeset:   5:506510493902
+  @  changeset:   5:f1d5f53e397b
   |  tag:         tip
-  |  parent:      3:adfeba9a1ac4
+  |  parent:      3:e28fd7fa7938
   |  user:        shelve@localhost
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     changes to: add A to bars
   |
-  | @  changeset:   4:8b023952e29c
+  | @  changeset:   4:fe451a778c81
   |/   user:        test
   |    date:        Thu Jan 01 00:00:00 1970 +0000
   |    summary:     add C to bars
   |
-  o  changeset:   3:adfeba9a1ac4
+  o  changeset:   3:e28fd7fa7938
   |  user:        test
   ~  date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add A to bars
@@ -1413,13 +1418,13 @@ 
 
 #if stripbased
   $ hg log -r 3:: -G
-  @  changeset:   4:8b023952e29c
+  @  changeset:   4:fe451a778c81
   |  tag:         tip
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     add C to bars
   |
-  o  changeset:   3:adfeba9a1ac4
+  o  changeset:   3:e28fd7fa7938
   |  user:        test
   ~  date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     add A to bars
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -1003,11 +1003,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: