Mercurial > evolve
comparison tests/test-evolve-order.t @ 2020:143c8e4dc22d
topic: merge the topic extension in the evolve repository
There is a lot of synergy between the two concepts. Topic is expected to be able
to smooth multiple of evolution sharp edge. Having them both in the same
repository will make this collaboration easier.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Mar 2017 18:07:46 +0100 |
parents | 9f42f819267b |
children | 4dd84054ebbb |
comparison
equal
deleted
inserted
replaced
2019:996a562b6c9f | 2020:143c8e4dc22d |
---|---|
1 evolve --rev reordering | |
2 ----------------------- | |
3 | |
4 $ cat >> $HGRCPATH <<EOF | |
5 > [defaults] | |
6 > amend=-d "0 0" | |
7 > fold=-d "0 0" | |
8 > [web] | |
9 > push_ssl = false | |
10 > allow_push = * | |
11 > [phases] | |
12 > publish = False | |
13 > [diff] | |
14 > git = 1 | |
15 > unified = 0 | |
16 > [ui] | |
17 > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n | |
18 > [extensions] | |
19 > hgext.graphlog= | |
20 > EOF | |
21 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH | |
22 $ mkcommit() { | |
23 > echo "$1" > "$1" | |
24 > hg add "$1" | |
25 > hg ci -m "add $1" | |
26 > } | |
27 | |
28 $ mkstack() { | |
29 > # Creates a stack of commit based on $1 with messages from $2, $3 .. | |
30 > hg update "$1" -C | |
31 > shift | |
32 > mkcommits $* | |
33 > } | |
34 | |
35 $ mkcommits() { | |
36 > for i in $@; do mkcommit $i ; done | |
37 > } | |
38 | |
39 Initial setup | |
40 $ hg init testrevorder | |
41 $ cd testrevorder | |
42 $ mkcommits p _a _b _c | |
43 $ hg phase --public 0 | |
44 $ hg up 'desc(_a)' | |
45 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
46 $ echo "aaa" > _a | |
47 $ hg amend | |
48 2 new unstable changesets | |
49 $ hg log -G | |
50 @ 5:12d519679175@default(draft) add _a | |
51 | | |
52 | o 3:4d156641b718@default(draft) add _c | |
53 | | | |
54 | o 2:4d7242ebb004@default(draft) add _b | |
55 | | | |
56 | x 1:2d73fcd7f07d@default(draft) add _a | |
57 |/ | |
58 o 0:f92638be10c7@default(public) add p | |
59 | |
60 | |
61 evolve --rev reorders the rev to solve instability, trivial case 2 revs wrong order | |
62 $ hg evolve --rev 'desc(_c) + desc(_b)' | |
63 move:[2] add _b | |
64 atop:[5] add _a | |
65 move:[3] add _c | |
66 atop:[6] add _b | |
67 working directory is now at 52b8f9b04f83 | |
68 | |
69 evolve --rev reorders the rev to solve instability. Harder case, obsolescence | |
70 accross three stacks in growing rev numbers. | |
71 $ hg up "desc(_c)" | |
72 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 $ mkcommit _d | |
74 $ hg up "desc(_a)" | |
75 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
76 $ hg amend -m "aprime" | |
77 3 new unstable changesets | |
78 $ hg evolve --rev "desc(_b)" | |
79 move:[6] add _b | |
80 atop:[9] aprime | |
81 working directory is now at 476c9c052aae | |
82 $ hg up "desc(_b) - obsolete()" | |
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
84 $ hg amend -m "bprime" | |
85 $ hg up "desc(aprime)" | |
86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
87 $ hg amend -m "asecond" | |
88 1 new unstable changesets | |
89 $ hg log -G | |
90 @ 12:9a584314f3f3@default(draft) asecond | |
91 | | |
92 | o 11:a59c79776f7c@default(draft) bprime | |
93 | | | |
94 | x 9:81a687b96d4d@default(draft) aprime | |
95 |/ | |
96 | o 8:464731bc0ed0@default(draft) add _d | |
97 | | | |
98 | o 7:52b8f9b04f83@default(draft) add _c | |
99 | | | |
100 | x 6:59476c3836ef@default(draft) add _b | |
101 | | | |
102 | x 5:12d519679175@default(draft) add _a | |
103 |/ | |
104 o 0:f92638be10c7@default(public) add p | |
105 | |
106 $ hg evolve --rev "unstable()" | |
107 move:[11] bprime | |
108 atop:[12] asecond | |
109 move:[7] add _c | |
110 atop:[13] bprime | |
111 move:[8] add _d | |
112 atop:[14] add _c | |
113 working directory is now at 739f18ac1d03 | |
114 $ hg log -G | |
115 @ 15:739f18ac1d03@default(draft) add _d | |
116 | | |
117 o 14:e5960578d158@default(draft) add _c | |
118 | | |
119 o 13:4ad33fa88946@default(draft) bprime | |
120 | | |
121 o 12:9a584314f3f3@default(draft) asecond | |
122 | | |
123 o 0:f92638be10c7@default(public) add p | |
124 | |
125 | |
126 Evolve --rev more complex case: two sets of stacks one with prune an no successor, the other one | |
127 partially solvable | |
128 | |
129 First set of stack: | |
130 $ mkstack "desc(_d)" c1_ c2_ c3_ c4_ >/dev/null | |
131 $ mkstack "desc(_d)" c1prime c2prime >/dev/null | |
132 $ mkstack "desc(_d)" c1second >/dev/null | |
133 $ hg prune "desc(c1_)" -s "desc(c1prime)" | |
134 1 changesets pruned | |
135 3 new unstable changesets | |
136 $ hg prune "desc(c2_)" -s "desc(c2prime)" | |
137 1 changesets pruned | |
138 $ hg prune "desc(c1prime)" -s "desc(c1second)" | |
139 1 changesets pruned | |
140 1 new unstable changesets | |
141 $ hg log -G -r "desc(_d)::" | |
142 @ 22:dcf786e878fd@default(draft) add c1second | |
143 | | |
144 | o 21:507d52d715f6@default(draft) add c2prime | |
145 | | | |
146 | x 20:c995cb124ddc@default(draft) add c1prime | |
147 |/ | |
148 | o 19:d096a2437fd0@default(draft) add c4_ | |
149 | | | |
150 | o 18:cde95c6cba7a@default(draft) add c3_ | |
151 | | | |
152 | x 17:e0d9f7a099fe@default(draft) add c2_ | |
153 | | | |
154 | x 16:43b7c338b1f8@default(draft) add c1_ | |
155 |/ | |
156 o 15:739f18ac1d03@default(draft) add _d | |
157 | | |
158 ~ | |
159 | |
160 Second set of stack with no successor for b2_: | |
161 $ mkstack "desc(_d)" b1_ b2_ b3_ b4_ >/dev/null | |
162 $ mkstack "desc(_d)" b1prime b3prime >/dev/null | |
163 $ hg prune "desc(b1_)" -s "desc(b1prime)" | |
164 1 changesets pruned | |
165 3 new unstable changesets | |
166 $ hg prune "desc(b3_)" -s "desc(b3prime)" | |
167 1 changesets pruned | |
168 $ hg prune "desc(b2_)" | |
169 1 changesets pruned | |
170 | |
171 $ hg log -G -r "desc(_d)::" | |
172 @ 28:b253ff5b65d1@default(draft) add b3prime | |
173 | | |
174 o 27:4acf61f11dfb@default(draft) add b1prime | |
175 | | |
176 | o 26:594e1fbbd61f@default(draft) add b4_ | |
177 | | | |
178 | x 25:be27500cfc76@default(draft) add b3_ | |
179 | | | |
180 | x 24:b54f77dc5831@default(draft) add b2_ | |
181 | | | |
182 | x 23:0e1eba27e9aa@default(draft) add b1_ | |
183 |/ | |
184 | o 22:dcf786e878fd@default(draft) add c1second | |
185 |/ | |
186 | o 21:507d52d715f6@default(draft) add c2prime | |
187 | | | |
188 | x 20:c995cb124ddc@default(draft) add c1prime | |
189 |/ | |
190 | o 19:d096a2437fd0@default(draft) add c4_ | |
191 | | | |
192 | o 18:cde95c6cba7a@default(draft) add c3_ | |
193 | | | |
194 | x 17:e0d9f7a099fe@default(draft) add c2_ | |
195 | | | |
196 | x 16:43b7c338b1f8@default(draft) add c1_ | |
197 |/ | |
198 o 15:739f18ac1d03@default(draft) add _d | |
199 | | |
200 ~ | |
201 | |
202 Solve the full second stack and only part of the first one | |
203 $ echo "(desc(_d)::) - desc(c3_)" | |
204 (desc(_d)::) - desc(c3_) | |
205 $ hg evolve --rev "(desc(_d)::) - desc(c3_)" | |
206 cannot solve instability of d096a2437fd0, skipping | |
207 move:[21] add c2prime | |
208 atop:[22] add c1second | |
209 move:[26] add b4_ | |
210 atop:[28] add b3prime | |
211 working directory is now at ea93190a9cd1 | |
212 | |
213 Cleanup | |
214 $ hg evolve --rev "(desc(_d)::)" | |
215 move:[18] add c3_ | |
216 atop:[29] add c2prime | |
217 move:[19] add c4_ | |
218 atop:[31] add c3_ | |
219 working directory is now at 35e7b797ace5 | |
220 $ hg log -G -r "desc(_d)::" | |
221 @ 32:35e7b797ace5@default(draft) add c4_ | |
222 | | |
223 o 31:0b9488394e89@default(draft) add c3_ | |
224 | | |
225 | o 30:ea93190a9cd1@default(draft) add b4_ | |
226 | | | |
227 o | 29:881b9c092e53@default(draft) add c2prime | |
228 | | | |
229 | o 28:b253ff5b65d1@default(draft) add b3prime | |
230 | | | |
231 | o 27:4acf61f11dfb@default(draft) add b1prime | |
232 | | | |
233 o | 22:dcf786e878fd@default(draft) add c1second | |
234 |/ | |
235 o 15:739f18ac1d03@default(draft) add _d | |
236 | | |
237 ~ | |
238 | |
239 Test multiple revision with some un-evolvable because parent is splitted | |
240 ------------------------------------------------------------------------ | |
241 | |
242 $ hg up 'desc(c2prime)' | |
243 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
244 $ mkcommit c3part1 | |
245 created new head | |
246 $ hg prev | |
247 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
248 [29] add c2prime | |
249 $ mkcommit c3part2 | |
250 created new head | |
251 $ hg prune -s 'desc(c3part1)' 'desc(c3_)' | |
252 1 changesets pruned | |
253 1 new unstable changesets | |
254 $ hg prune -s 'desc(c3part2)' 'desc(c3_)' | |
255 1 changesets pruned | |
256 2 new divergent changesets | |
257 $ hg up 'desc(b3prime)' | |
258 2 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
259 $ hg amend -m 'b3second' | |
260 1 new unstable changesets | |
261 $ hg evolve --rev 'unstable()' | |
262 move:[30] add b4_ | |
263 atop:[35] b3second | |
264 skipping 0b9488394e89: divergent rewriting. can't choose destination | |
265 working directory is now at 31809a198477 | |
266 |