changeset 6108:ed68f64f5d0f

tests: move next --abort case to its own test-next-abort.t, add hg abort hg abort command currently reports "evolve aborted" when aborting next, but works otherwise as expected. This happens because next uses evolve state file (naturally, since next currently performs evolution by default).
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 07 Dec 2021 21:05:42 +0300
parents cb5e056048d0
children f196f76d8683
files tests/test-check-sdist.t tests/test-next-abort.t tests/test-prev-next.t
diffstat 3 files changed, 62 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-check-sdist.t	Fri Dec 10 13:34:40 2021 +0300
+++ b/tests/test-check-sdist.t	Tue Dec 07 21:05:42 2021 +0300
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  352 files
+  353 files
   $ fgrep debian files
   tests/test-check-debian.t
   $ fgrep __init__.py files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-next-abort.t	Tue Dec 07 21:05:42 2021 +0300
@@ -0,0 +1,61 @@
+Testing hg next with --abort flag and hg abort command handling an interrupted hg next
+
+  $ . "$TESTDIR/testlib/common.sh"
+
+  $ cat >> "$HGRCPATH" << EOF
+  > [extensions]
+  > evolve =
+  > EOF
+
+  $ hg init next-abort
+  $ cd next-abort
+
+  $ echo apple > a
+  $ hg ci -qAm apple
+  $ echo banana > b
+  $ hg ci -qAm banana
+  $ hg up 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo blueberry > b
+  $ hg ci -qAm 'apple and blueberry' --amend
+  1 new orphan changesets
+
+  $ hg next
+  move:[1] banana
+  atop:[2] apple and blueberry
+  merging b
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  unresolved merge conflicts
+  (see 'hg help evolve.interrupted')
+  [240]
+
+#testcases abortcommand abortflag
+#if abortflag
+  $ hg next --abort
+  next aborted
+  working directory is now at 1c7f51cf0ef0
+  $ hg next --abort
+  abort: no interrupted next to abort
+  [255]
+  $ hg evolve --abort
+  abort: no interrupted evolve to abort
+  [255]
+
+  $ hg next --abort --move-bookmark
+  abort: cannot specify both --abort and --move-bookmark
+  [10]
+  $ hg next --abort --merge
+  abort: cannot specify both --abort and --merge
+  [10]
+#else
+  $ hg abort --dry-run
+  evolve in progress, will be aborted
+  $ hg abort
+  evolve aborted
+  working directory is now at 1c7f51cf0ef0
+  $ hg abort
+  abort: no operation in progress
+  [20]
+#endif
+
+  $ cd ..
--- a/tests/test-prev-next.t	Fri Dec 10 13:34:40 2021 +0300
+++ b/tests/test-prev-next.t	Tue Dec 07 21:05:42 2021 +0300
@@ -611,49 +611,6 @@
 
   $ cd ..
 
-hg next --abort
-
-  $ hg init next-abort
-  $ cd next-abort
-
-  $ echo apple > a
-  $ hg ci -qAm apple
-  $ echo banana > b
-  $ hg ci -qAm banana
-  $ hg up 0
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ echo blueberry > b
-  $ hg ci -qAm 'apple and blueberry' --amend
-  1 new orphan changesets
-
-  $ hg next
-  move:[1] banana
-  atop:[2] apple and blueberry
-  merging b
-  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
-  unresolved merge conflicts
-  (see 'hg help evolve.interrupted')
-  [240]
-
-  $ hg next --abort
-  next aborted
-  working directory is now at 1c7f51cf0ef0
-  $ hg next --abort
-  abort: no interrupted next to abort
-  [255]
-  $ hg evolve --abort
-  abort: no interrupted evolve to abort
-  [255]
-
-  $ hg next --abort --move-bookmark
-  abort: cannot specify both --abort and --move-bookmark
-  [10]
-  $ hg next --abort --merge
-  abort: cannot specify both --abort and --merge
-  [10]
-
-  $ cd ..
-
 Testing --merge and --evolve flags: 1 child, 1 aspchild, dirty working copy
 
   $ hg init next-dirty-evolve