diff tests/test-commit-unresolved.t @ 42600:3bc400ccbf99

abort: added support for merge This adds support of `hg merge --abort` to `hg abort` plan. This involves refactoring `hg.merge` into two different functions removing the abort logic of `merge` from `hg.merge` and then creating a seperate `hg.abortmerge` to handle the abort logic so that the abortion of merge can be called independently. `hg.abortmerge` is then registered as `abortfunc` for the state detection API so that `commands.abort` can use it to deal with an unfinished merge operation. Results are shown as tests. Differential Revision: https://phab.mercurial-scm.org/D6588
author Taapas Agrawal <taapas2897@gmail.com>
date Sun, 30 Jun 2019 01:07:14 +0530
parents 41ef02ba329b
children 75c2ca094d3a
line wrap: on
line diff
--- a/tests/test-commit-unresolved.t	Wed Jun 26 22:15:07 2019 +0530
+++ b/tests/test-commit-unresolved.t	Sun Jun 30 01:07:14 2019 +0530
@@ -1,3 +1,11 @@
+#testcases abortcommand abortflag
+#if abortflag
+  $ cat >> $HGRCPATH <<EOF
+  > [alias]
+  > abort = merge --abort
+  > EOF
+#endif
+
   $ addcommit () {
   >     echo $1 > $1
   >     hg add $1
@@ -36,9 +44,11 @@
 
 Testing the abort functionality first in case of conflicts
 
-  $ hg merge --abort
-  abort: no merge in progress
+  $ hg abort
+  abort: no merge in progress (abortflag !)
+  abort: no operation in progress (abortcommand !)
   [255]
+
   $ hg merge
   merging A
   warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
@@ -53,7 +63,13 @@
   abort: cannot specify both --rev and --abort
   [255]
 
-  $ hg merge --abort
+#if abortcommand
+when in dry-run mode
+  $ hg abort --dry-run
+  merge in progress, will be aborted
+#endif
+
+  $ hg abort
   aborting the merge, updating back to e45016d2b3d3
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
@@ -131,7 +147,7 @@
   abort: cannot specify --preview with --abort
   [255]
 
-  $ hg merge --abort
+  $ hg abort
   aborting the merge, updating back to 68352a18a7c4
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved