Mercurial > evolve
comparison tests/test-evolve-abort-contentdiv.t @ 3773:958dad74e877
tests: add tests for testing --abort while content-divergence resolution
This patch adds a new test file with a very basic test of `--abort` on an
interrupted evolve which was resolving content-divergence. Upcoming patches will
add more rigourous tests.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 24 May 2018 02:02:11 +0530 |
parents | |
children | 63d6d024dfb2 |
comparison
equal
deleted
inserted
replaced
3772:6240579fd0c0 | 3773:958dad74e877 |
---|---|
1 Tests for the --abort flag for `hg evolve` command while content-divergence resolution | |
2 ====================================================================================== | |
3 | |
4 The `--abort` flag aborts the interuppted evolve by undoing all the work which | |
5 was done during resolution i.e. stripping new changesets created, moving | |
6 bookmarks back, moving working directory back. | |
7 | |
8 This test contains cases when `hg evolve` is doing content-divergence resolution. | |
9 | |
10 Setup | |
11 ===== | |
12 | |
13 $ cat >> $HGRCPATH <<EOF | |
14 > [phases] | |
15 > publish = False | |
16 > [alias] | |
17 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}" | |
18 > [extensions] | |
19 > EOF | |
20 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH | |
21 | |
22 $ hg init abortrepo | |
23 $ cd abortrepo | |
24 $ echo ".*\.orig" > .hgignore | |
25 $ hg add .hgignore | |
26 $ hg ci -m "added hgignore" | |
27 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done; | |
28 | |
29 $ hg glog | |
30 @ 4:c41c793e0ef1 added d | |
31 | () draft | |
32 o 3:ca1b80f7960a added c | |
33 | () draft | |
34 o 2:b1661037fa25 added b | |
35 | () draft | |
36 o 1:c7586e2a9264 added a | |
37 | () draft | |
38 o 0:8fa14d15e168 added hgignore | |
39 () draft | |
40 | |
41 Creating content divergence, resolution of which will lead to conflicts | |
42 ----------------------------------------------------------------------- | |
43 | |
44 $ echo bar > d | |
45 $ hg amend | |
46 | |
47 $ hg up c41c793e0ef1 --hidden | |
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
49 updated to hidden changeset c41c793e0ef1 | |
50 (hidden revision 'c41c793e0ef1' was rewritten as: e49523854bc8) | |
51 working directory parent is obsolete! (c41c793e0ef1) | |
52 (use 'hg evolve' to update to its successor: e49523854bc8) | |
53 | |
54 $ echo foobar > d | |
55 $ hg amend | |
56 2 new content-divergent changesets | |
57 $ hg glog --hidden | |
58 @ 6:9c1631e352d9 added d | |
59 | () draft | |
60 | * 5:e49523854bc8 added d | |
61 |/ () draft | |
62 | x 4:c41c793e0ef1 added d | |
63 |/ () draft | |
64 o 3:ca1b80f7960a added c | |
65 | () draft | |
66 o 2:b1661037fa25 added b | |
67 | () draft | |
68 o 1:c7586e2a9264 added a | |
69 | () draft | |
70 o 0:8fa14d15e168 added hgignore | |
71 () draft | |
72 | |
73 $ hg evolve --content-divergent | |
74 merge:[6] added d | |
75 with: [5] added d | |
76 base: [4] added d | |
77 merging "other" content-divergent changeset 'e49523854bc8' | |
78 merging d | |
79 warning: conflicts while merging d! (edit, then use 'hg resolve --mark') | |
80 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
81 abort: fix conflicts and run 'hg evolve --continue' or use 'hg update -C .' to abort | |
82 [255] | |
83 | |
84 $ hg evolve --abort | |
85 evolve aborted | |
86 working directory is now at 9c1631e352d9 | |
87 | |
88 $ hg glog --hidden | |
89 @ 6:9c1631e352d9 added d | |
90 | () draft | |
91 | * 5:e49523854bc8 added d | |
92 |/ () draft | |
93 | x 4:c41c793e0ef1 added d | |
94 |/ () draft | |
95 o 3:ca1b80f7960a added c | |
96 | () draft | |
97 o 2:b1661037fa25 added b | |
98 | () draft | |
99 o 1:c7586e2a9264 added a | |
100 | () draft | |
101 o 0:8fa14d15e168 added hgignore | |
102 () draft |