changeset 48270:3e66e4517744 stable

merge-halt: demonstrate unshelve issue with merge.on-failure=halt Differential Revision: https://phab.mercurial-scm.org/D11705
author Kyle Lippincott <spectral@google.com>
date Tue, 19 Oct 2021 16:14:46 -0700
parents aa88fb60ecb4
children 5228a6dc212b
files tests/test-merge-halt.t
diffstat 1 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-merge-halt.t	Tue Oct 19 19:05:41 2021 +0200
+++ b/tests/test-merge-halt.t	Tue Oct 19 16:14:46 2021 -0700
@@ -162,3 +162,57 @@
   merging b
   $TESTTMP/repo/a *a~base* *a~other* (glob)
   $TESTTMP/repo/b *b~base* *b~other* (glob)
+
+Check that unshelve isn't broken by halting the merge
+  $ cat <<EOS >> $HGRCPATH
+  > [extensions]
+  > shelve =
+  > EOS
+  $ echo foo > shelve_file1
+  $ echo foo > shelve_file2
+  $ hg ci -qAm foo
+  $ echo bar >> shelve_file1
+  $ echo bar >> shelve_file2
+  $ hg shelve --list
+  $ hg shelve
+  shelved as default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo baz >> shelve_file1
+  $ echo baz >> shelve_file2
+  $ hg ci -m baz
+  $ hg unshelve --tool false --config merge-tools.false.premerge=keep
+  unshelving change 'default'
+  rebasing shelved changes
+  merging shelve_file1
+  merging shelve_file2
+  merging shelve_file1 failed!
+  merge halted after failed merge (see hg resolve)
+  [240]
+FIXME: This should claim it's in an 'unshelve' state
+  $ hg status --config commands.status.verbose=True
+  M shelve_file1
+  M shelve_file2
+  ? shelve_file1.orig
+  ? shelve_file2.orig
+  # The repository is in an unfinished *update* state.
+  
+  # Unresolved merge conflicts:
+  # 
+  #     shelve_file1
+  #     shelve_file2
+  # 
+  # To mark files as resolved:  hg resolve --mark FILE
+  
+  # To continue:    hg update .
+  
+FIXME: This should not be referencing a stripped commit.
+  $ hg resolve --tool false --all --re-merge
+  abort: unknown revision '4a1d727ea5bb6aed9adfacb2a8f776bae44301d6'
+  [255]
+Ensure the shelve is still around, since we haven't finished the operation yet.
+  $ hg shelve --list
+  default         (* ago)    changes to: foo (glob)
+FIXME: `hg unshelve --abort` should work.
+  $ hg unshelve --abort
+  abort: no unshelve in progress
+  [20]