D952: merge: additional test cases to show changing behavior

2017-10-05 Thread ryanmce (Ryan McElroy)
ryanmce created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Depends on https://phab.mercurial-scm.org/D951.
  
  In the next patch more cases of failed file merges will be able to halt the
  merge process. Add some test cases so that the failures are more obvious.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-merge-halt.t

CHANGE DETAILS

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
@@ -73,3 +73,75 @@
   $ hg rebase --abort
   rebase aborted
 
+Check that successful tool with failed post-check halts the merge
+  $ echo onfailure=halt >> $HGRCPATH
+  $ cat <> $HGRCPATH
+  > [merge-tools]
+  > true.check=changed
+  > EOS
+  $ hg rebase -s 1 -d 2 --tool true
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+   output file a appears unchanged
+  was merge successful (yn)? n
+  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 conflicts
+  $ cat <> $HGRCPATH
+  > [merge-tools]
+  > true.check=conflicts
+  > true.premerge=keep
+  > 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]
+
+Check conflict prompts
+  $ hg rebase --abort
+  rebase aborted
+  $ hg rebase -s 1 -d 2 --tool true --config merge-tools.true.check=prompt
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+  was merge of 'a' successful (yn)? n
+  merging a failed!
+  merge halted after failed merge (see hg resolve)
+  [1]
+  $ hg rebase --abort
+  rebase aborted
+
+Check that a requested abort actually works
+  $ cat < n
+  > EOS
+  rebasing 1:1f28a51c3c9b "c"
+  merging a
+  merging b
+  merging a failed!
+  merge halted after failed merge (see hg resolve)
+  [1]
+
+  $ 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)



To: ryanmce, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D952: merge: additional test cases to show changing behavior

2017-10-06 Thread ryanmce (Ryan McElroy)
ryanmce updated this revision to Diff 2503.

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

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

AFFECTED FILES
  tests/test-merge-halt.t

CHANGE DETAILS

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 <> $HGRCPATH
+  > [merge]
+  > on-failure=prompt
+  > [ui]
+  > interactive=1
+  > EOS
+  $ cat < y
   > n
   > EOS
@@ -77,3 +82,83 @@
   $ hg rebase --abort
   rebase aborted
 
+Check that successful tool with failed post-check halts the merge
+  $ cat <> $HGRCPATH
+  > [merge-tools]
+  > true.check=changed
+  > EOS
+  $ cat < 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 <> $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 < 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)



To: ryanmce, #hg-reviewers, mbthomas
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D952: merge: additional test cases to show changing behavior

2017-10-16 Thread durin42 (Augie Fackler)
durin42 added a comment.


  https://phab.mercurial-scm.org/D953 is abandoned-  should this be as well?

REPOSITORY
  rHG Mercurial

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

To: ryanmce, #hg-reviewers, mbthomas
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D952: merge: additional test cases to show changing behavior

2017-10-17 Thread ryanmce (Ryan McElroy)
ryanmce added a comment.


  > https://phab.mercurial-scm.org/D953 is abandoned- should this be as well?
  
  No, but it should probably be retitled. I'll do that now.
  
  It turns out that the behavior did change, but only slightly, and not in a 
useful way, with the https://phab.mercurial-scm.org/D953. This still adds 
useful tests that show that the other ways of saying a file merge process 
didn't go well also can halt the merge.

REPOSITORY
  rHG Mercurial

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

To: ryanmce, #hg-reviewers, mbthomas
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel