tests: add more tests to test-evolve-continue.t
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 04 Feb 2018 20:58:03 +0530
changeset 3491 92df1aac8c7f
parent 3490 51c0a23b519e
child 3492 53cd61f7f9c9
tests: add more tests to test-evolve-continue.t This patch adds more tests for `hg evolve --continue`. The tests demonstrates how the continuation handling of hg evolve is broken and the later patches fixes that handling.
tests/test-evolve-continue.t
--- a/tests/test-evolve-continue.t	Mon Jan 22 18:52:27 2018 +0530
+++ b/tests/test-evolve-continue.t	Sun Feb 04 20:58:03 2018 +0530
@@ -143,3 +143,233 @@
   o  0:8fa14d15e168 added hgignore
       () draft
 
+Case when there are a lot of revision to continue
+
+  $ hg up c7586e2a9264
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo bar > b
+  $ hg add b
+  $ hg amend
+  3 new orphan changesets
+
+  $ hg evolve --all
+  move:[2] added b
+  atop:[9] added a
+  merging b
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  evolve failed!
+  fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
+  abort: unresolved merge conflicts (see hg help resolve)
+  [255]
+
+  $ echo foo > b
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+  $ hg evolve --continue
+  evolving 2:b1661037fa25 "added b"
+
+  $ hg glog
+  @  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  | *  8:00a5c774cc37 added d
+  | |   () draft
+  | *  5:cb6a2ab625bb added c
+  | |   () draft
+  | x  2:b1661037fa25 added b
+  | |   () draft
+  | x  1:c7586e2a9264 added a
+  |/    () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft
+
+XXX: we should not have required an extra call to `hg evolve` here
+
+  $ hg evolve --all
+  move:[5] added c
+  atop:[10] added b
+  move:[8] added d
+  atop:[11] added c
+  working directory is now at 6642d2c9176e
+
+  $ hg glog
+  @  12:6642d2c9176e added d
+  |   () draft
+  o  11:95665a2de664 added c
+  |   () draft
+  o  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft
+
+Conlicts -> resolve -> continue -> conflicts -> resolve -> continue
+Test multiple conflicts in one evolve
+
+  $ for ch in f g h; do echo foo > $ch; hg add $ch; hg ci -m "added "$ch; done;
+
+  $ hg glog
+  @  15:09becba8f97d added h
+  |   () draft
+  o  14:5aa7b2bbd944 added g
+  |   () draft
+  o  13:be88f889b6dc added f
+  |   () draft
+  o  12:6642d2c9176e added d
+  |   () draft
+  o  11:95665a2de664 added c
+  |   () draft
+  o  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft
+
+  $ hg up 95665a2de664
+  1 files updated, 0 files merged, 4 files removed, 0 files unresolved
+
+  $ echo bar > f
+  $ echo bar > h
+  $ hg add f h
+  $ hg amend
+  4 new orphan changesets
+
+  $ hg glog
+  @  16:645135c5caa4 added c
+  |   () draft
+  | *  15:09becba8f97d added h
+  | |   () draft
+  | *  14:5aa7b2bbd944 added g
+  | |   () draft
+  | *  13:be88f889b6dc added f
+  | |   () draft
+  | *  12:6642d2c9176e added d
+  | |   () draft
+  | x  11:95665a2de664 added c
+  |/    () draft
+  o  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft
+
+  $ hg evolve --all
+  move:[12] added d
+  atop:[16] added c
+  move:[13] added f
+  atop:[17] added d
+  merging f
+  warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
+  evolve failed!
+  fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
+  abort: unresolved merge conflicts (see hg help resolve)
+  [255]
+
+  $ echo foo > f
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+  $ hg evolve --continue
+  evolving 13:be88f889b6dc "added f"
+
+XXX: we should not require this extra `hg evolve --all` call
+
+  $ hg evolve --all
+  move:[14] added g
+  atop:[18] added f
+  move:[15] added h
+  atop:[19] added g
+  merging h
+  warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
+  evolve failed!
+  fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
+  abort: unresolved merge conflicts (see hg help resolve)
+  [255]
+
+  $ echo foo > h
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+  $ hg evolve --continue
+  evolving 15:09becba8f97d "added h"
+
+Make sure, confirmopt is respected while continue
+
+  $ hg glog
+  @  20:3ba9d3d1b089 added h
+  |   () draft
+  o  19:981e615b14ca added g
+  |   () draft
+  o  18:5794f1a3cbb2 added f
+  |   () draft
+  o  17:e47537da02b3 added d
+  |   () draft
+  o  16:645135c5caa4 added c
+  |   () draft
+  o  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft
+
+  $ hg up 5794f1a3cbb2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo bar > g
+  $ hg add g
+  $ hg amend
+  2 new orphan changesets
+
+  $ hg evolve --all --confirm<<EOF
+  > y
+  > EOF
+  move:[19] added g
+  atop:[21] added f
+  perform evolve? [Ny] y
+  merging g
+  warning: conflicts while merging g! (edit, then use 'hg resolve --mark')
+  evolve failed!
+  fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort
+  abort: unresolved merge conflicts (see hg help resolve)
+  [255]
+
+  $ echo foo > g
+  $ hg resolve -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+
+XXX: so this evolve should continue the rest of evolve and ask for confirmation
+before evolving. evolve --continue is broken right now and should be fixed.
+
+  $ hg evolve --continue
+  evolving 19:981e615b14ca "added g"
+
+XXX: we should not need this extra call to evolve
+
+  $ hg evolve --all
+  move:[20] added h
+  atop:[22] added g
+  working directory is now at af6bd002a48d
+
+  $ hg glog
+  @  23:af6bd002a48d added h
+  |   () draft
+  o  22:d2c94a8f44bd added g
+  |   () draft
+  o  21:9849fa96c885 added f
+  |   () draft
+  o  17:e47537da02b3 added d
+  |   () draft
+  o  16:645135c5caa4 added c
+  |   () draft
+  o  10:87f748868183 added b
+  |   () draft
+  o  9:53b632d203d8 added a
+  |   () draft
+  o  0:8fa14d15e168 added hgignore
+      () draft