comparison tests/test-evolve-order.t @ 1370:0799c5831a3d

evolve: move test for evolve --rev ordering in a separate file evolve --rev reordering is a complicated enough topic to justify a separate test.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 16 Jun 2015 14:49:28 -0700
parents 4ed67cce8c23
children b3afdc0815d0
comparison
equal deleted inserted replaced
1369:4ed67cce8c23 1370:0799c5831a3d
25 > hg ci -m "add $1" 25 > hg ci -m "add $1"
26 > } 26 > }
27 27
28 $ mkstack() { 28 $ mkstack() {
29 > # Creates a stack of commit based on $1 with messages from $2, $3 .. 29 > # Creates a stack of commit based on $1 with messages from $2, $3 ..
30 > hg update $1 -C 30 > hg update "$1" -C
31 > shift 31 > shift
32 > mkcommits $* 32 > mkcommits $*
33 > }
34
35 $ shaof() {
36 > hg log -T {node} -r "first(desc($1))"
37 > } 33 > }
38 34
39 $ mkcommits() { 35 $ mkcommits() {
40 > for i in $@; do mkcommit $i ; done 36 > for i in $@; do mkcommit $i ; done
41 > } 37 > }
72 68
73 evolve --rev reorders the rev to solve instability. Harder case, obsolescence 69 evolve --rev reorders the rev to solve instability. Harder case, obsolescence
74 accross three stacks in growing rev numbers. 70 accross three stacks in growing rev numbers.
75 $ hg up "desc(_c)" 71 $ hg up "desc(_c)"
76 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 72 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 $ mkcommit d 73 $ mkcommit _d
78 $ hg up "desc(_a)" 74 $ hg up "desc(_a)"
79 0 files updated, 0 files merged, 3 files removed, 0 files unresolved 75 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
80 $ hg amend -m "aprime" 76 $ hg amend -m "aprime"
81 3 new unstable changesets 77 3 new unstable changesets
82 $ hg evolve --rev "desc(_b)" 78 $ hg evolve --rev "desc(_b)"
95 | 91 |
96 | o 11:a59c79776f7c@default(draft) bprime 92 | o 11:a59c79776f7c@default(draft) bprime
97 | | 93 | |
98 | x 9:81a687b96d4d@default(draft) aprime 94 | x 9:81a687b96d4d@default(draft) aprime
99 |/ 95 |/
100 | o 8:2d86cc7ec3a9@default(draft) add d 96 | o 8:464731bc0ed0@default(draft) add _d
101 | | 97 | |
102 | o 7:52b8f9b04f83@default(draft) add _c 98 | o 7:52b8f9b04f83@default(draft) add _c
103 | | 99 | |
104 | x 6:59476c3836ef@default(draft) add _b 100 | x 6:59476c3836ef@default(draft) add _b
105 | | 101 | |
110 $ hg evolve --rev "unstable()" 106 $ hg evolve --rev "unstable()"
111 move:[11] bprime 107 move:[11] bprime
112 atop:[12] asecond 108 atop:[12] asecond
113 move:[7] add _c 109 move:[7] add _c
114 atop:[13] bprime 110 atop:[13] bprime
115 move:[8] add d 111 move:[8] add _d
116 atop:[14] add _c 112 atop:[14] add _c
117 working directory is now at fd447ba1b20b 113 working directory is now at 225d2cc5d3fc
118 $ hg log -G 114 $ hg log -G
119 @ 15:fd447ba1b20b@default(draft) add d 115 @ 15:225d2cc5d3fc@default(draft) add _d
120 | 116 |
121 o 14:0fc229278e4d@default(draft) add _c 117 o 14:0fc229278e4d@default(draft) add _c
122 | 118 |
123 o 13:c3741b9eafae@default(draft) bprime 119 o 13:c3741b9eafae@default(draft) bprime
124 | 120 |
125 o 12:9a584314f3f3@default(draft) asecond 121 o 12:9a584314f3f3@default(draft) asecond
126 | 122 |
127 o 0:f92638be10c7@default(public) add p 123 o 0:f92638be10c7@default(public) add p
128 124
129 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:a329855d0bc1@default(draft) add c1second
143 |
144 | o 21:072276ece1bf@default(draft) add c2prime
145 | |
146 | x 20:f137acd06692@default(draft) add c1prime
147 |/
148 | o 19:0a1d9b2ce733@default(draft) add c4_
149 | |
150 | o 18:e2874f41c56c@default(draft) add c3_
151 | |
152 | x 17:3247c33339fa@default(draft) add c2_
153 | |
154 | x 16:df322257c182@default(draft) add c1_
155 |/
156 o 15:225d2cc5d3fc@default(draft) add _d
157 |
158
159 Second set of stack with no successor for b2_:
160 $ mkstack "desc(_d)" b1_ b2_ b3_ b4_ >/dev/null
161 $ mkstack "desc(_d)" b1prime b3prime >/dev/null
162 $ hg prune "desc(b1_)" -s "desc(b1prime)"
163 1 changesets pruned
164 3 new unstable changesets
165 $ hg prune "desc(b3_)" -s "desc(b3prime)"
166 1 changesets pruned
167 $ hg prune "desc(b2_)"
168 1 changesets pruned
169
170 $ hg log -G -r "desc(_d)::"
171 @ 28:ba4c348b6d5e@default(draft) add b3prime
172 |
173 o 27:8fe985f5d0aa@default(draft) add b1prime
174 |
175 | o 26:1d9ba2e75c93@default(draft) add b4_
176 | |
177 | x 25:aec6a9657b6c@default(draft) add b3_
178 | |
179 | x 24:a69b58575918@default(draft) add b2_
180 | |
181 | x 23:3564eb18e448@default(draft) add b1_
182 |/
183 | o 22:a329855d0bc1@default(draft) add c1second
184 |/
185 | o 21:072276ece1bf@default(draft) add c2prime
186 | |
187 | x 20:f137acd06692@default(draft) add c1prime
188 |/
189 | o 19:0a1d9b2ce733@default(draft) add c4_
190 | |
191 | o 18:e2874f41c56c@default(draft) add c3_
192 | |
193 | x 17:3247c33339fa@default(draft) add c2_
194 | |
195 | x 16:df322257c182@default(draft) add c1_
196 |/
197 o 15:225d2cc5d3fc@default(draft) add _d
198 |
199
200 Solve the full second stack and only part of the first one
201 $ echo "(desc(_d)::) - desc(c3_)"
202 (desc(_d)::) - desc(c3_)
203 $ hg evolve --rev "(desc(_d)::) - desc(c3_)"
204 cannot solve instability of 0a1d9b2ce733, skipping
205 move:[21] add c2prime
206 atop:[22] add c1second
207 move:[26] add b4_
208 atop:[28] add b3prime
209 working directory is now at 4897c8ed7645
210
211 Cleanup
212 $ hg evolve --rev "(desc(_d)::)"
213 move:[18] add c3_
214 atop:[29] add c2prime
215 move:[19] add c4_
216 atop:[31] add c3_
217 working directory is now at 4ee8feb52325
218 $ hg log -G -r "desc(_d)::"
219 @ 32:4ee8feb52325@default(draft) add c4_
220 |
221 o 31:08a530ce67e1@default(draft) add c3_
222 |
223 | o 30:4897c8ed7645@default(draft) add b4_
224 | |
225 o | 29:3abc7618dd5f@default(draft) add c2prime
226 | |
227 | o 28:ba4c348b6d5e@default(draft) add b3prime
228 | |
229 | o 27:8fe985f5d0aa@default(draft) add b1prime
230 | |
231 o | 22:a329855d0bc1@default(draft) add c1second
232 |/
233 o 15:225d2cc5d3fc@default(draft) add _d
234 |
235
236
237