Patchwork D952: merge: additional test cases to show merge-halting behavior

login
register
mail settings
Submitter phabricator
Date Oct. 18, 2017, 8:27 p.m.
Message ID <688e3621b7a3e3b2b22ad1875506767d@localhost.localdomain>
Download mbox | patch
Permalink /patch/25205/
State Not Applicable
Headers show

Comments

phabricator - Oct. 18, 2017, 8:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe10bac797852: merge: additional test cases to show merge-halting behavior (authored by ryanmce, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D952?vs=2503&id=2996

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

AFFECTED FILES
  tests/test-merge-halt.t

CHANGE DETAILS




To: ryanmce, #hg-reviewers, mbthomas, durin42
Cc: durin42, mercurial-devel

Patch

diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t
--- a/tests/test-merge-halt.t
+++ b/tests/test-merge-halt.t
@@ -55,8 +55,13 @@ 
   rebase aborted
 
 Testing on-failure=prompt
-  $ echo on-failure=prompt >> $HGRCPATH
-  $ cat <<EOS | hg rebase -s 1 -d 2 --tool false --config ui.interactive=1
+  $ cat <<EOS >> $HGRCPATH
+  > [merge]
+  > on-failure=prompt
+  > [ui]
+  > interactive=1
+  > EOS
+  $ cat <<EOS | hg rebase -s 1 -d 2 --tool false
   > y
   > n
   > EOS
@@ -77,3 +82,83 @@ 
   $ hg rebase --abort
   rebase aborted
 
+Check that successful tool with failed post-check halts the merge
+  $ cat <<EOS >> $HGRCPATH
+  > [merge-tools]
+  > true.check=changed
+  > EOS
+  $ cat <<EOS | hg rebase -s 1 -d 2 --tool true
+  > y
+  > n
+  > n
+  > EOS
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+   output file a appears unchanged
+  was merge successful (yn)? y
+   output file b appears unchanged
+  was merge successful (yn)? n
+  merging b failed!
+  continue merge operation (yn)? n
+  merge halted after failed merge (see hg resolve)
+  [1]
+
+  $ hg resolve --list
+  R a
+  U b
+
+  $ hg rebase --abort
+  rebase aborted
+
+Check that conflicts with conflict check also halts the merge
+  $ cat <<EOS >> $HGRCPATH
+  > [merge-tools]
+  > true.check=conflicts
+  > true.premerge=keep
+  > [merge]
+  > on-failure=halt
+  > EOS
+  $ hg rebase -s 1 -d 2 --tool true
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+  merging a failed!
+  merge halted after failed merge (see hg resolve)
+  [1]
+
+  $ hg resolve --list
+  U a
+  U b
+
+  $ hg rebase --abort
+  rebase aborted
+
+Check that always-prompt also can halt the merge
+  $ cat <<EOS | hg rebase -s 1 -d 2 --tool true --config merge-tools.true.check=prompt
+  > y
+  > n
+  > EOS
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+  was merge of 'a' successful (yn)? y
+  was merge of 'b' successful (yn)? n
+  merging b failed!
+  merge halted after failed merge (see hg resolve)
+  [1]
+
+  $ hg resolve --list
+  R a
+  U b
+
+  $ hg rebase --abort
+  rebase aborted
+
+Check that successful tool otherwise allows the merge to continue
+  $ hg rebase -s 1 -d 2 --tool echo --keep --config merge-tools.echo.premerge=keep
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+  $TESTTMP/repo/a *a~base* *a~other* (glob)
+  $TESTTMP/repo/b *b~base* *b~other* (glob)