Patchwork D6686: unshelve: handle stripping changesets on interactive mode

login
register
mail settings
Submitter phabricator
Date Aug. 2, 2019, 8:16 a.m.
Message ID <ddd37a0d0bb0828862e1e7d23d4a19f3@localhost.localdomain>
Download mbox | patch
Permalink /patch/41116/
State Not Applicable
Headers show

Comments

phabricator - Aug. 2, 2019, 8:16 a.m.
navaneeth.suresh updated this revision to Diff 16108.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6686?vs=16065&id=16108

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

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

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

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
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
@@ -1357,11 +1357,33 @@ 
   A
   B
   C
+
+#if stripbased
+  $ hg log -r 3:: -G
+  @  changeset:   5:506510493902
+  |  tag:         tip
+  |  parent:      3:adfeba9a1ac4
+  |  user:        shelve@localhost
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     changes to: add A to bars
+  |
+  | @  changeset:   4:8b023952e29c
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     add C to bars
+  |
+  o  changeset:   3:adfeba9a1ac4
+  |  user:        test
+  ~  date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     add A to bars
+  
+#endif
+
   $ hg unshelve --continue <<EOF
   > y
   > y
   > y
-  > y
+  > n
   > EOF
   diff --git a/bar1 b/bar1
   1 hunks, 1 lines changed
@@ -1385,6 +1407,21 @@ 
   +B
    C
   record change 2/2 to 'bar2'?
-  (enter ? for help) [Ynesfdaq?] y
+  (enter ? for help) [Ynesfdaq?] n
   
   unshelve of 'default-01' complete
+
+#if stripbased
+  $ hg log -r 3:: -G
+  @  changeset:   4:8b023952e29c
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add C to bars
+  |
+  o  changeset:   3:adfeba9a1ac4
+  |  user:        test
+  ~  date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     add A to bars
+  
+#endif
diff --git a/mercurial/shelve.py b/mercurial/shelve.py
--- a/mercurial/shelve.py
+++ b/mercurial/shelve.py
@@ -747,10 +747,10 @@ 
         mergefiles(ui, repo, state.wctx, shelvectx)
         restorebranch(ui, repo, state.branchtorestore)
 
+        if not phases.supportinternal(repo):
+            repair.strip(ui, repo, state.nodestoremove, backup=False,
+                         topic='shelve')
         if not ispartialunshelve:
-            if not phases.supportinternal(repo):
-                repair.strip(ui, repo, state.nodestoremove, backup=False,
-                            topic='shelve')
             shelvedstate.clear(repo)
             unshelvecleanup(ui, repo, state.name, opts)
         _restoreactivebookmark(repo, state.activebookmark)