Mercurial > evolve
annotate tests/test-evolve-stop-phasediv.t @ 3754:73ee40cbfb53
evolve: return the new replacement node to be stored in evolvestate
While resolving phase-divergence, we can end up obsoleting the phase-divergent
commit in favor of the public commit. Before this patch we return the node of
public commit to store as a replacement of the phase-divergent commit.
The above will not cause any problem till the time we use `hg evolve --abort` on
an interrupted evolve which tries to strip the replacement nodes because it
thinks that the replacements nodes are the ones which are created during the
resolution and are new.
Since we will be stripping a public node, `evolve --abort` will error out saying
cannot strip public changeset, unable to abort evolve which is bad.
We should make sure, replacements should only consist of new nodes formed. If
the instablity is resolved by obsoleting in favour of old changeset, we should
not store the old changeset in replacements in evolvestate.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 23 May 2018 02:33:14 +0530 |
parents | 422294cd682f |
children | f0096db2a7b1 |
rev | line source |
---|---|
3732
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
1 Tests for the --stop flag for `hg evolve` command while resolving phase-divergence |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
2 ================================================================================== |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
3 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
4 The `--stop` flag stops the interrupted evolution and delete the state file so |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
5 user can do other things and comeback and do evolution later on |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
6 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
7 This is testing cases when `hg evolve` command is doing phase-divergence resolution. |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
8 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
9 Setup |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
10 ===== |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
11 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
12 $ cat >> $HGRCPATH <<EOF |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
13 > [alias] |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
14 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}" |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
15 > [extensions] |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
16 > EOF |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
17 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
18 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
19 $ hg init stoprepo |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
20 $ cd stoprepo |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
21 $ echo ".*\.orig" > .hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
22 $ hg add .hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
23 $ hg ci -m "added hgignore" |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
24 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done; |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
25 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
26 $ hg glog |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
27 @ 4:c41c793e0ef1 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
28 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
29 o 3:ca1b80f7960a added c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
30 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
31 o 2:b1661037fa25 added b |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
32 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
33 o 1:c7586e2a9264 added a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
34 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
35 o 0:8fa14d15e168 added hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
36 () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
37 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
38 Creating phase divergence, resolution of which will lead to conflicts |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
39 ---------------------------------------------------------------------- |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
40 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
41 $ hg up .^^^ |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
42 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
43 $ hg grab -r .~-3 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
44 grabbing 4:c41c793e0ef1 "added d" |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
45 $ echo foobar > c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
46 $ hg add c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
47 $ hg amend |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
48 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
49 $ hg glog --hidden |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
50 @ 6:ddba58020bc0 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
51 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
52 | x 5:cfe30edc6125 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
53 |/ () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
54 | x 4:c41c793e0ef1 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
55 | | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
56 | o 3:ca1b80f7960a added c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
57 | | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
58 | o 2:b1661037fa25 added b |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
59 |/ () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
60 o 1:c7586e2a9264 added a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
61 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
62 o 0:8fa14d15e168 added hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
63 () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
64 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
65 $ hg phase -r c41c793e0ef1 --public --hidden |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
66 1 new phase-divergent changesets |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
67 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
68 $ hg glog |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
69 @ 6:ddba58020bc0 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
70 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
71 | o 4:c41c793e0ef1 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
72 | | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
73 | o 3:ca1b80f7960a added c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
74 | | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
75 | o 2:b1661037fa25 added b |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
76 |/ () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
77 o 1:c7586e2a9264 added a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
78 | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
79 o 0:8fa14d15e168 added hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
80 () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
81 $ hg evolve --phase-divergent |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
82 recreate:[6] added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
83 atop:[4] added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
84 rebasing to destination parent: ca1b80f7960a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
85 merging c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
86 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
87 evolution failed! |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
88 fix conflict then run 'hg evolve --continue' or use `hg evolve --abort` |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
89 abort: unresolved merge conflicts (see hg help resolve) |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
90 [255] |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
91 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
92 $ hg evolve --stop |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
93 stopped the interrupted evolve |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
94 working directory is now at ca1b80f7960a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
95 |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
96 XXX: maybe we should update wdir to where it was |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
97 $ hg glog |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
98 * 6:ddba58020bc0 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
99 | () draft |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
100 | o 4:c41c793e0ef1 added d |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
101 | | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
102 | @ 3:ca1b80f7960a added c |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
103 | | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
104 | o 2:b1661037fa25 added b |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
105 |/ () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
106 o 1:c7586e2a9264 added a |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
107 | () public |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
108 o 0:8fa14d15e168 added hgignore |
422294cd682f
tests: add test showing `hg evolve --stop` works fine with phase-divergence
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
109 () public |