|
1 This test file test the various messages when accessing obsolete |
|
2 revisions. |
|
3 |
|
4 Global setup |
|
5 ============ |
|
6 |
|
7 $ . $TESTDIR/testlib/obsmarker-common.sh |
|
8 $ cat >> $HGRCPATH <<EOF |
|
9 > [ui] |
|
10 > interactive = true |
|
11 > [phases] |
|
12 > publish=False |
|
13 > [experimental] |
|
14 > evolution.createmarkers = yes |
|
15 > evolution.effect-flags = yes |
|
16 > EOF |
|
17 |
|
18 Test output on amended commit |
|
19 ============================= |
|
20 |
|
21 Test setup |
|
22 ---------- |
|
23 |
|
24 $ hg init $TESTTMP/local-amend |
|
25 $ cd $TESTTMP/local-amend |
|
26 $ mkcommit ROOT |
|
27 $ mkcommit A0 |
|
28 $ echo 42 >> A0 |
|
29 $ hg commit --amend -m "A1 |
|
30 > |
|
31 > Better commit message" |
|
32 $ hg log --hidden -G |
|
33 @ changeset: 2:4ae3a4151de9 |
|
34 | tag: tip |
|
35 | parent: 0:ea207398892e |
|
36 | user: test |
|
37 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
38 | summary: A1 |
|
39 | |
|
40 | x changeset: 1:471f378eab4c |
|
41 |/ user: test |
|
42 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
43 | obsolete: rewritten using amend as 2:4ae3a4151de9 |
|
44 | summary: A0 |
|
45 | |
|
46 o changeset: 0:ea207398892e |
|
47 user: test |
|
48 date: Thu Jan 01 00:00:00 1970 +0000 |
|
49 summary: ROOT |
|
50 |
|
51 Actual test |
|
52 ----------- |
|
53 $ hg update 471f378eab4c |
|
54 abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! |
|
55 (use --hidden to access hidden revisions) |
|
56 [255] |
|
57 $ hg update --hidden "desc(A0)" |
|
58 updating to a hidden changeset 471f378eab4c |
|
59 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
60 |
|
61 Test output with pruned commit |
|
62 ============================== |
|
63 |
|
64 Test setup |
|
65 ---------- |
|
66 |
|
67 $ hg init $TESTTMP/local-prune |
|
68 $ cd $TESTTMP/local-prune |
|
69 $ mkcommit ROOT |
|
70 $ mkcommit A0 # 0 |
|
71 $ mkcommit B0 # 1 |
|
72 $ hg log --hidden -G |
|
73 @ changeset: 2:0dec01379d3b |
|
74 | tag: tip |
|
75 | user: test |
|
76 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
77 | summary: B0 |
|
78 | |
|
79 o changeset: 1:471f378eab4c |
|
80 | user: test |
|
81 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
82 | summary: A0 |
|
83 | |
|
84 o changeset: 0:ea207398892e |
|
85 user: test |
|
86 date: Thu Jan 01 00:00:00 1970 +0000 |
|
87 summary: ROOT |
|
88 |
|
89 $ hg debugobsolete --record-parents `getid 'desc(B0)'` |
|
90 obsoleted 1 changesets |
|
91 |
|
92 $ hg log --hidden -G |
|
93 @ changeset: 2:0dec01379d3b |
|
94 | tag: tip |
|
95 | user: test |
|
96 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
97 | obsolete: pruned |
|
98 | summary: B0 |
|
99 | |
|
100 o changeset: 1:471f378eab4c |
|
101 | user: test |
|
102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
103 | summary: A0 |
|
104 | |
|
105 o changeset: 0:ea207398892e |
|
106 user: test |
|
107 date: Thu Jan 01 00:00:00 1970 +0000 |
|
108 summary: ROOT |
|
109 |
|
110 |
|
111 Actual test |
|
112 ----------- |
|
113 $ hg up 1 |
|
114 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
115 $ hg up 0dec01379d3b |
|
116 abort: hidden revision '0dec01379d3b' is pruned! |
|
117 (use --hidden to access hidden revisions) |
|
118 [255] |
|
119 $ hg up --hidden -r 'desc(B0)' |
|
120 updating to a hidden changeset 0dec01379d3b |
|
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
122 |
|
123 Test output with splitted commit |
|
124 ================================ |
|
125 |
|
126 Test setup |
|
127 ---------- |
|
128 |
|
129 $ hg init $TESTTMP/local-split |
|
130 $ cd $TESTTMP/local-split |
|
131 $ mkcommit ROOT |
|
132 $ echo 42 >> a |
|
133 $ echo 43 >> b |
|
134 $ hg commit -A -m "A0" |
|
135 adding a |
|
136 adding b |
|
137 $ hg log --hidden -G |
|
138 @ changeset: 1:471597cad322 |
|
139 | tag: tip |
|
140 | user: test |
|
141 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
142 | summary: A0 |
|
143 | |
|
144 o changeset: 0:ea207398892e |
|
145 user: test |
|
146 date: Thu Jan 01 00:00:00 1970 +0000 |
|
147 summary: ROOT |
|
148 |
|
149 # Simulate a split |
|
150 $ hg up 0 |
|
151 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
152 |
|
153 $ echo 42 >> a |
|
154 $ hg commit -A -m "A0" |
|
155 adding a |
|
156 created new head |
|
157 |
|
158 $ echo 43 >> b |
|
159 $ hg commit -A -m "A0" |
|
160 adding b |
|
161 |
|
162 $ hg debugobsolete `getid '1'` `getid '2'` `getid '3'` |
|
163 obsoleted 1 changesets |
|
164 |
|
165 $ hg log --hidden -G |
|
166 @ changeset: 3:f257fde29c7a |
|
167 | tag: tip |
|
168 | user: test |
|
169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | summary: A0 |
|
171 | |
|
172 o changeset: 2:337fec4d2edc |
|
173 | parent: 0:ea207398892e |
|
174 | user: test |
|
175 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
176 | summary: A0 |
|
177 | |
|
178 | x changeset: 1:471597cad322 |
|
179 |/ user: test |
|
180 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
181 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a |
|
182 | summary: A0 |
|
183 | |
|
184 o changeset: 0:ea207398892e |
|
185 user: test |
|
186 date: Thu Jan 01 00:00:00 1970 +0000 |
|
187 summary: ROOT |
|
188 |
|
189 Actual test |
|
190 ----------- |
|
191 $ hg update 471597cad322 |
|
192 abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a! |
|
193 (use --hidden to access hidden revisions) |
|
194 [255] |
|
195 $ hg update --hidden 'min(desc(A0))' |
|
196 updating to a hidden changeset 471597cad322 |
|
197 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
198 |
|
199 Test output with lots of splitted commit |
|
200 ======================================== |
|
201 |
|
202 Test setup |
|
203 ---------- |
|
204 |
|
205 $ hg init $TESTTMP/local-lots-split |
|
206 $ cd $TESTTMP/local-lots-split |
|
207 $ mkcommit ROOT |
|
208 $ echo 42 >> a |
|
209 $ echo 43 >> b |
|
210 $ echo 44 >> c |
|
211 $ echo 45 >> d |
|
212 $ hg commit -A -m "A0" |
|
213 adding a |
|
214 adding b |
|
215 adding c |
|
216 adding d |
|
217 $ hg log --hidden -G |
|
218 @ changeset: 1:de7290d8b885 |
|
219 | tag: tip |
|
220 | user: test |
|
221 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
222 | summary: A0 |
|
223 | |
|
224 o changeset: 0:ea207398892e |
|
225 user: test |
|
226 date: Thu Jan 01 00:00:00 1970 +0000 |
|
227 summary: ROOT |
|
228 |
|
229 # Simulate a split |
|
230 $ hg up 0 |
|
231 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
232 |
|
233 $ echo 42 >> a |
|
234 $ hg commit -A -m "A0" |
|
235 adding a |
|
236 created new head |
|
237 |
|
238 $ echo 43 >> b |
|
239 $ hg commit -A -m "A0" |
|
240 adding b |
|
241 |
|
242 $ echo 44 >> c |
|
243 $ hg commit -A -m "A0" |
|
244 adding c |
|
245 |
|
246 $ echo 45 >> d |
|
247 $ hg commit -A -m "A0" |
|
248 adding d |
|
249 |
|
250 $ hg debugobsolete `getid '1'` `getid '2'` `getid '3'` `getid '4'` `getid '5'` |
|
251 obsoleted 1 changesets |
|
252 |
|
253 $ hg log --hidden -G |
|
254 @ changeset: 5:c7f044602e9b |
|
255 | tag: tip |
|
256 | user: test |
|
257 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
258 | summary: A0 |
|
259 | |
|
260 o changeset: 4:1ae8bc733a14 |
|
261 | user: test |
|
262 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
263 | summary: A0 |
|
264 | |
|
265 o changeset: 3:f257fde29c7a |
|
266 | user: test |
|
267 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
268 | summary: A0 |
|
269 | |
|
270 o changeset: 2:337fec4d2edc |
|
271 | parent: 0:ea207398892e |
|
272 | user: test |
|
273 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
274 | summary: A0 |
|
275 | |
|
276 | x changeset: 1:de7290d8b885 |
|
277 |/ user: test |
|
278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
279 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a, 4:1ae8bc733a14, 5:c7f044602e9b |
|
280 | summary: A0 |
|
281 | |
|
282 o changeset: 0:ea207398892e |
|
283 user: test |
|
284 date: Thu Jan 01 00:00:00 1970 +0000 |
|
285 summary: ROOT |
|
286 |
|
287 Actual test |
|
288 ----------- |
|
289 $ hg update de7290d8b885 |
|
290 abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more! |
|
291 (use --hidden to access hidden revisions) |
|
292 [255] |
|
293 $ hg update --hidden 'min(desc(A0))' |
|
294 updating to a hidden changeset de7290d8b885 |
|
295 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
296 |
|
297 Test output with folded commit |
|
298 ============================== |
|
299 |
|
300 Test setup |
|
301 ---------- |
|
302 |
|
303 $ hg init $TESTTMP/local-fold |
|
304 $ cd $TESTTMP/local-fold |
|
305 $ mkcommit ROOT |
|
306 $ mkcommit A0 |
|
307 $ mkcommit B0 |
|
308 $ hg log --hidden -G |
|
309 @ changeset: 2:0dec01379d3b |
|
310 | tag: tip |
|
311 | user: test |
|
312 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
313 | summary: B0 |
|
314 | |
|
315 o changeset: 1:471f378eab4c |
|
316 | user: test |
|
317 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
318 | summary: A0 |
|
319 | |
|
320 o changeset: 0:ea207398892e |
|
321 user: test |
|
322 date: Thu Jan 01 00:00:00 1970 +0000 |
|
323 summary: ROOT |
|
324 |
|
325 # Simulate a fold |
|
326 $ hg up 0 |
|
327 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
328 $ echo "A0" > A0 |
|
329 $ echo "B0" > B0 |
|
330 $ hg add A0 B0 |
|
331 $ hg commit -m "C0" |
|
332 created new head |
|
333 |
|
334 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(C0)'` |
|
335 obsoleted 1 changesets |
|
336 $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(C0)'` |
|
337 obsoleted 1 changesets |
|
338 |
|
339 $ hg log --hidden -G |
|
340 @ changeset: 3:eb5a0daa2192 |
|
341 | tag: tip |
|
342 | parent: 0:ea207398892e |
|
343 | user: test |
|
344 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
345 | summary: C0 |
|
346 | |
|
347 | x changeset: 2:0dec01379d3b |
|
348 | | user: test |
|
349 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
350 | | obsolete: rewritten as 3:eb5a0daa2192 |
|
351 | | summary: B0 |
|
352 | | |
|
353 | x changeset: 1:471f378eab4c |
|
354 |/ user: test |
|
355 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
356 | obsolete: rewritten as 3:eb5a0daa2192 |
|
357 | summary: A0 |
|
358 | |
|
359 o changeset: 0:ea207398892e |
|
360 user: test |
|
361 date: Thu Jan 01 00:00:00 1970 +0000 |
|
362 summary: ROOT |
|
363 |
|
364 Actual test |
|
365 ----------- |
|
366 $ hg update 471f378eab4c |
|
367 abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192! |
|
368 (use --hidden to access hidden revisions) |
|
369 [255] |
|
370 $ hg update --hidden 'desc(A0)' |
|
371 updating to a hidden changeset 471f378eab4c |
|
372 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
373 $ hg update 0dec01379d3b |
|
374 abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192! |
|
375 (use --hidden to access hidden revisions) |
|
376 [255] |
|
377 $ hg update --hidden 'desc(B0)' |
|
378 updating to a hidden changeset 0dec01379d3b |
|
379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
380 |
|
381 Test output with divergence |
|
382 =========================== |
|
383 |
|
384 Test setup |
|
385 ---------- |
|
386 |
|
387 $ hg init $TESTTMP/local-divergence |
|
388 $ cd $TESTTMP/local-divergence |
|
389 $ mkcommit ROOT |
|
390 $ mkcommit A0 |
|
391 $ hg commit --amend -m "A1" |
|
392 $ hg log --hidden -G |
|
393 @ changeset: 2:fdf9bde5129a |
|
394 | tag: tip |
|
395 | parent: 0:ea207398892e |
|
396 | user: test |
|
397 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
398 | summary: A1 |
|
399 | |
|
400 | x changeset: 1:471f378eab4c |
|
401 |/ user: test |
|
402 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
403 | obsolete: rewritten using amend as 2:fdf9bde5129a |
|
404 | summary: A0 |
|
405 | |
|
406 o changeset: 0:ea207398892e |
|
407 user: test |
|
408 date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 summary: ROOT |
|
410 |
|
411 $ hg update --hidden 'desc(A0)' |
|
412 updating to a hidden changeset 471f378eab4c |
|
413 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
414 $ hg commit --amend -m "A2" |
|
415 $ hg log --hidden -G |
|
416 @ changeset: 3:65b757b745b9 |
|
417 | tag: tip |
|
418 | parent: 0:ea207398892e |
|
419 | user: test |
|
420 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
421 | instability: content-divergent |
|
422 | summary: A2 |
|
423 | |
|
424 | * changeset: 2:fdf9bde5129a |
|
425 |/ parent: 0:ea207398892e |
|
426 | user: test |
|
427 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | instability: content-divergent |
|
429 | summary: A1 |
|
430 | |
|
431 | x changeset: 1:471f378eab4c |
|
432 |/ user: test |
|
433 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
434 | obsolete: rewritten using amend as 2:fdf9bde5129a |
|
435 | obsolete: rewritten using amend as 3:65b757b745b9 |
|
436 | summary: A0 |
|
437 | |
|
438 o changeset: 0:ea207398892e |
|
439 user: test |
|
440 date: Thu Jan 01 00:00:00 1970 +0000 |
|
441 summary: ROOT |
|
442 |
|
443 Actual test |
|
444 ----------- |
|
445 $ hg update 471f378eab4c |
|
446 abort: hidden revision '471f378eab4c' has diverged! |
|
447 (use --hidden to access hidden revisions) |
|
448 [255] |
|
449 $ hg update --hidden 'desc(A0)' |
|
450 updating to a hidden changeset 471f378eab4c |
|
451 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
452 |
|
453 Test output with amended + folded commit |
|
454 ======================================== |
|
455 |
|
456 Test setup |
|
457 ---------- |
|
458 |
|
459 $ hg init $TESTTMP/local-amend-fold |
|
460 $ cd $TESTTMP/local-amend-fold |
|
461 $ mkcommit ROOT |
|
462 $ mkcommit A0 |
|
463 $ mkcommit B0 |
|
464 $ hg commit --amend -m "B1" |
|
465 $ hg log --hidden -G |
|
466 @ changeset: 3:b7ea6d14e664 |
|
467 | tag: tip |
|
468 | parent: 1:471f378eab4c |
|
469 | user: test |
|
470 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
471 | summary: B1 |
|
472 | |
|
473 | x changeset: 2:0dec01379d3b |
|
474 |/ user: test |
|
475 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
476 | obsolete: rewritten using amend as 3:b7ea6d14e664 |
|
477 | summary: B0 |
|
478 | |
|
479 o changeset: 1:471f378eab4c |
|
480 | user: test |
|
481 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
482 | summary: A0 |
|
483 | |
|
484 o changeset: 0:ea207398892e |
|
485 user: test |
|
486 date: Thu Jan 01 00:00:00 1970 +0000 |
|
487 summary: ROOT |
|
488 |
|
489 |
|
490 # Simulate a fold |
|
491 $ hg up 0 |
|
492 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
493 $ echo "A0" > A0 |
|
494 $ echo "B0" > B0 |
|
495 $ hg add A0 B0 |
|
496 $ hg commit -m "C0" |
|
497 created new head |
|
498 |
|
499 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(C0)'` |
|
500 obsoleted 1 changesets |
|
501 $ hg debugobsolete `getid 'desc(B1)'` `getid 'desc(C0)'` |
|
502 obsoleted 1 changesets |
|
503 |
|
504 $ hg log --hidden -G |
|
505 @ changeset: 4:eb5a0daa2192 |
|
506 | tag: tip |
|
507 | parent: 0:ea207398892e |
|
508 | user: test |
|
509 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
510 | summary: C0 |
|
511 | |
|
512 | x changeset: 3:b7ea6d14e664 |
|
513 | | parent: 1:471f378eab4c |
|
514 | | user: test |
|
515 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
516 | | obsolete: rewritten as 4:eb5a0daa2192 |
|
517 | | summary: B1 |
|
518 | | |
|
519 | | x changeset: 2:0dec01379d3b |
|
520 | |/ user: test |
|
521 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
522 | | obsolete: rewritten using amend as 3:b7ea6d14e664 |
|
523 | | summary: B0 |
|
524 | | |
|
525 | x changeset: 1:471f378eab4c |
|
526 |/ user: test |
|
527 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
528 | obsolete: rewritten as 4:eb5a0daa2192 |
|
529 | summary: A0 |
|
530 | |
|
531 o changeset: 0:ea207398892e |
|
532 user: test |
|
533 date: Thu Jan 01 00:00:00 1970 +0000 |
|
534 summary: ROOT |
|
535 |
|
536 Actual test |
|
537 ----------- |
|
538 $ hg update 471f378eab4c |
|
539 abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192! |
|
540 (use --hidden to access hidden revisions) |
|
541 [255] |
|
542 $ hg update --hidden 'desc(A0)' |
|
543 updating to a hidden changeset 471f378eab4c |
|
544 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
545 $ hg update --hidden 0dec01379d3b |
|
546 updating to a hidden changeset 0dec01379d3b |
|
547 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
548 $ hg update 0dec01379d3b |
|
549 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
550 $ hg update --hidden 'desc(B0)' |
|
551 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |