comparison tests/test-evolve-stop-orphan.t @ 3817:5ca297e78f2c mercurial-4.4

test-compat: merge mercurial-4.5 into mercurial-4.4
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 08 Jun 2018 22:52:52 +0530
parents tests/test-evolve-stop.t@19ec729f3ca2 tests/test-evolve-stop.t@83dc216b9e9a
children f8677cb11dcb d00f0c369bc7
comparison
equal deleted inserted replaced
3723:e70ad3983872 3817:5ca297e78f2c
1 Tests for the --stop flag for `hg evolve` command while resolving orphans
2 =========================================================================
3
4 The `--stop` flag stops the interrupted evolution and delete the state file so
5 user can do other things and comeback and do evolution later on
6
7 This is testing cases when `hg evolve` command is doing orphan resolution.
8
9 Setup
10 =====
11
12 $ cat >> $HGRCPATH <<EOF
13 > [alias]
14 > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
15 > [extensions]
16 > EOF
17 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
18
19 $ hg init stoprepo
20 $ cd stoprepo
21 $ echo ".*\.orig" > .hgignore
22 $ hg add .hgignore
23 $ hg ci -m "added hgignore"
24 $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done;
25
26 $ hg glog
27 @ 4:c41c793e0ef1 added d
28 | () draft
29 o 3:ca1b80f7960a added c
30 | () draft
31 o 2:b1661037fa25 added b
32 | () draft
33 o 1:c7586e2a9264 added a
34 | () draft
35 o 0:8fa14d15e168 added hgignore
36 () draft
37
38 Testing `--stop` when no evolve is interrupted
39 ==============================================
40
41 $ hg evolve --stop
42 abort: no interrupted evolve to stop
43 [255]
44
45 Testing with wrong combinations of flags
46 ========================================
47
48 $ hg evolve --stop --rev 1
49 abort: cannot specify both "--rev" and "--stop"
50 [255]
51
52 $ hg evolve --stop --continue
53 abort: cannot specify both "--stop" and "--continue"
54 [255]
55
56 $ hg evolve --stop --all
57 abort: cannot specify both "--all" and "--stop"
58 [255]
59
60 $ hg evolve --stop --any
61 abort: cannot specify both "--any" and "--stop"
62 [255]
63
64 Testing when only one revision is to evolve
65 ===========================================
66
67 $ hg prev
68 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 [3] added c
70 $ echo bar > d
71 $ hg add d
72 $ hg amend
73 1 new orphan changesets
74 $ hg glog
75 @ 5:cb6a2ab625bb added c
76 | () draft
77 | o 4:c41c793e0ef1 added d
78 | | () draft
79 | x 3:ca1b80f7960a added c
80 |/ () draft
81 o 2:b1661037fa25 added b
82 | () draft
83 o 1:c7586e2a9264 added a
84 | () draft
85 o 0:8fa14d15e168 added hgignore
86 () draft
87
88 $ hg evolve
89 move:[4] added d
90 atop:[5] added c
91 merging d
92 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
93 evolve failed!
94 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
95 abort: unresolved merge conflicts (see hg help resolve)
96 [255]
97
98 $ hg evolve --stop
99 stopped the interrupted evolve
100 working directory is now at cb6a2ab625bb
101
102 Checking whether evolvestate file exists or not
103 $ cat .hg/evolvestate
104 cat: .hg/evolvestate: No such file or directory
105 [1]
106
107 Checking where we are
108 $ hg id
109 cb6a2ab625bb tip
110
111 Checking working dir
112 $ hg status
113 Checking for incomplete mergestate
114 $ ls .hg/merge
115 ls: cannot access .?\.hg/merge.?: No such file or directory (re)
116 [2]
117
118 Checking graph
119 $ hg glog
120 @ 5:cb6a2ab625bb added c
121 | () draft
122 | o 4:c41c793e0ef1 added d
123 | | () draft
124 | x 3:ca1b80f7960a added c
125 |/ () draft
126 o 2:b1661037fa25 added b
127 | () draft
128 o 1:c7586e2a9264 added a
129 | () draft
130 o 0:8fa14d15e168 added hgignore
131 () draft
132
133 Testing the stop flag in case conflicts are caused by `hg next --evolve`
134 ========================================================================
135
136 $ hg next --evolve
137 move:[4] added d
138 atop:[5] added c
139 merging d
140 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
141 evolve failed!
142 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
143 abort: unresolved merge conflicts (see hg help resolve)
144 [255]
145
146 $ hg diff
147 diff -r cb6a2ab625bb d
148 --- a/d Thu Jan 01 00:00:00 1970 +0000
149 +++ b/d Thu Jan 01 00:00:00 1970 +0000
150 @@ -1,1 +1,5 @@
151 +<<<<<<< destination: cb6a2ab625bb - test: added c
152 bar
153 +=======
154 +foo
155 +>>>>>>> evolving: c41c793e0ef1 - test: added d
156
157 $ hg evolve --stop
158 stopped the interrupted evolve
159 working directory is now at cb6a2ab625bb
160
161 $ hg glog
162 @ 5:cb6a2ab625bb added c
163 | () draft
164 | o 4:c41c793e0ef1 added d
165 | | () draft
166 | x 3:ca1b80f7960a added c
167 |/ () draft
168 o 2:b1661037fa25 added b
169 | () draft
170 o 1:c7586e2a9264 added a
171 | () draft
172 o 0:8fa14d15e168 added hgignore
173 () draft
174
175 $ hg status
176
177 Checking when multiple revs need to be evolved, some revs evolve without
178 conflicts
179 =========================================================================
180
181 Making sure obsmarkers should be on evolved changeset and not rest of them once
182 we do `evolve --stop`
183 --------------------------------------------------------------------------------
184
185 $ hg evolve
186 move:[4] added d
187 atop:[5] added c
188 merging d
189 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
190 evolve failed!
191 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
192 abort: unresolved merge conflicts (see hg help resolve)
193 [255]
194 $ echo foo > d
195 $ hg resolve -m
196 (no more unresolved files)
197 continue: hg evolve --continue
198 $ hg evolve --continue
199 evolving 4:c41c793e0ef1 "added d"
200 working directory is now at 2a4e03d422e2
201 $ hg glog
202 @ 6:2a4e03d422e2 added d
203 | () draft
204 o 5:cb6a2ab625bb added c
205 | () draft
206 o 2:b1661037fa25 added b
207 | () draft
208 o 1:c7586e2a9264 added a
209 | () draft
210 o 0:8fa14d15e168 added hgignore
211 () draft
212
213 $ hg up .^^^^
214 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
215 $ echo bar > c
216 $ hg add c
217 $ hg amend
218 4 new orphan changesets
219
220 $ hg glog
221 @ 7:21817cd42526 added hgignore
222 () draft
223 o 6:2a4e03d422e2 added d
224 | () draft
225 o 5:cb6a2ab625bb added c
226 | () draft
227 o 2:b1661037fa25 added b
228 | () draft
229 o 1:c7586e2a9264 added a
230 | () draft
231 x 0:8fa14d15e168 added hgignore
232 () draft
233
234 $ hg evolve --all
235 move:[1] added a
236 atop:[7] added hgignore
237 move:[2] added b
238 atop:[8] added a
239 move:[5] added c
240 atop:[9] added b
241 merging c
242 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
243 evolve failed!
244 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
245 abort: unresolved merge conflicts (see hg help resolve)
246 [255]
247
248 $ hg status
249 M c
250 A d
251
252 $ hg evolve --stop
253 stopped the interrupted evolve
254 working directory is now at aec285328e90
255
256 Only changeset which has a successor now are obsoleted
257 $ hg glog
258 @ 9:aec285328e90 added b
259 | () draft
260 o 8:fd00db71edca added a
261 | () draft
262 o 7:21817cd42526 added hgignore
263 () draft
264 o 6:2a4e03d422e2 added d
265 | () draft
266 o 5:cb6a2ab625bb added c
267 | () draft
268 x 2:b1661037fa25 added b
269 | () draft
270 x 1:c7586e2a9264 added a
271 | () draft
272 x 0:8fa14d15e168 added hgignore
273 () draft
274
275 Making sure doing evolve again resumes from right place and does the right thing
276
277 $ hg evolve --all
278 move:[5] added c
279 atop:[9] added b
280 merging c
281 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
282 evolve failed!
283 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
284 abort: unresolved merge conflicts (see hg help resolve)
285 [255]
286
287 $ echo foobar > c
288 $ hg resolve -m
289 (no more unresolved files)
290 continue: hg evolve --continue
291 $ hg evolve --continue
292 evolving 5:cb6a2ab625bb "added c"
293 move:[6] added d
294 atop:[10] added c
295 working directory is now at cd0909a30222
296 $ hg glog
297 @ 11:cd0909a30222 added d
298 | () draft
299 o 10:cb1dd1086ef6 added c
300 | () draft
301 o 9:aec285328e90 added b
302 | () draft
303 o 8:fd00db71edca added a
304 | () draft
305 o 7:21817cd42526 added hgignore
306 () draft
307
308 Bookmarks should only be moved of the changesets which have been evolved,
309 bookmarks of rest of them should stay where they are are
310 -------------------------------------------------------------------------
311
312 $ hg up .^
313 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
314 $ hg bookmark b1
315 $ hg up .^
316 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
317 (leaving bookmark b1)
318 $ hg bookmark b2
319
320 $ hg glog
321 o 11:cd0909a30222 added d
322 | () draft
323 o 10:cb1dd1086ef6 added c
324 | (b1) draft
325 @ 9:aec285328e90 added b
326 | (b2) draft
327 o 8:fd00db71edca added a
328 | () draft
329 o 7:21817cd42526 added hgignore
330 () draft
331
332 $ hg prev
333 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
334 [8] added a
335 $ echo tom > c
336 $ hg amend
337 3 new orphan changesets
338
339 $ hg glog
340 @ 12:a3cc2042492f added a
341 | () draft
342 | o 11:cd0909a30222 added d
343 | | () draft
344 | o 10:cb1dd1086ef6 added c
345 | | (b1) draft
346 | o 9:aec285328e90 added b
347 | | (b2) draft
348 | x 8:fd00db71edca added a
349 |/ () draft
350 o 7:21817cd42526 added hgignore
351 () draft
352
353 $ hg evolve --all
354 move:[9] added b
355 atop:[12] added a
356 move:[10] added c
357 atop:[13] added b
358 merging c
359 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
360 evolve failed!
361 fix conflict and run 'hg evolve --continue' or use 'hg evolve --abort' to abort
362 abort: unresolved merge conflicts (see hg help resolve)
363 [255]
364
365 $ hg evolve --stop
366 stopped the interrupted evolve
367 working directory is now at a3f4b95da934
368
369 Bookmarks of only the changeset which are evolved is moved
370 $ hg glog
371 @ 13:a3f4b95da934 added b
372 | (b2) draft
373 o 12:a3cc2042492f added a
374 | () draft
375 | o 11:cd0909a30222 added d
376 | | () draft
377 | o 10:cb1dd1086ef6 added c
378 | | (b1) draft
379 | x 9:aec285328e90 added b
380 | | () draft
381 | x 8:fd00db71edca added a
382 |/ () draft
383 o 7:21817cd42526 added hgignore
384 () draft