comparison tests/test-evolve-obshistory.t @ 2336:93a37e13424f

obshistory: add a debugobshistory command to show obs history of a revs Add the debugobshistory command that accept a revision range and display the obsolescence containing each revision in the range. For the moment, it only displays the predecessors.
author Boris Feld <boris.feld@octobus.net>
date Wed, 10 May 2017 12:26:33 +0200
parents a36a8c6a09ac
children e28026b4d3c1
comparison
equal deleted inserted replaced
2335:f7ce3b9167d6 2336:93a37e13424f
23 $ hg init $TESTTMP/local-amend 23 $ hg init $TESTTMP/local-amend
24 $ cd $TESTTMP/local-amend 24 $ cd $TESTTMP/local-amend
25 $ mkcommit ROOT 25 $ mkcommit ROOT
26 $ mkcommit A0 26 $ mkcommit A0
27 $ echo 42 >> A0 27 $ echo 42 >> A0
28 $ hg amend -m "A1" 28 $ hg amend -m "A1
29 $ hg log --hidden -G 29 >
30 @ changeset: 3:a468dc9b3633 30 > Better commit message"
31 $ hg log --hidden -G
32 @ changeset: 3:4ae3a4151de9
31 | tag: tip 33 | tag: tip
32 | parent: 0:ea207398892e 34 | parent: 0:ea207398892e
33 | user: test 35 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000 36 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: A1 37 | summary: A1
49 date: Thu Jan 01 00:00:00 1970 +0000 51 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: ROOT 52 summary: ROOT
51 53
52 Actual test 54 Actual test
53 ----------- 55 -----------
54 56 $ hg debugobshistory 4ae3a4151de9
57 4ae3a4151de9 (3) A1
58 471f378eab4c (1) A0
59 rewritten by test (*20*) as 4ae3a4151de9 (glob)
60 $ hg debugobshistory --hidden 471f378eab4c
61 471f378eab4c (1) A0
62 rewritten by test (*20*) as 4ae3a4151de9 (glob)
55 $ hg update 471f378eab4c 63 $ hg update 471f378eab4c
56 abort: hidden revision '471f378eab4c'! 64 abort: hidden revision '471f378eab4c'!
57 (use --hidden to access hidden revisions; successor: a468dc9b3633) 65 (use --hidden to access hidden revisions; successor: 4ae3a4151de9)
58 [255] 66 [255]
59 $ hg update --hidden "desc(A0)" 67 $ hg update --hidden "desc(A0)"
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 working directory parent is obsolete! (471f378eab4c) 69 working directory parent is obsolete! (471f378eab4c)
62 (use 'hg evolve' to update to its successor: a468dc9b3633) 70 (use 'hg evolve' to update to its successor: 4ae3a4151de9)
63 71
64 Test output with pruned commit 72 Test output with pruned commit
65 ============================== 73 ==============================
66 74
67 Test setup 75 Test setup
91 99
92 $ hg prune -r 'desc(B0)' 100 $ hg prune -r 'desc(B0)'
93 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 101 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
94 working directory now at 471f378eab4c 102 working directory now at 471f378eab4c
95 1 changesets pruned 103 1 changesets pruned
104 $ hg log --hidden -G
105 x changeset: 2:0dec01379d3b
106 | tag: tip
107 | user: test
108 | date: Thu Jan 01 00:00:00 1970 +0000
109 | summary: B0
110 |
111 @ changeset: 1:471f378eab4c
112 | user: test
113 | date: Thu Jan 01 00:00:00 1970 +0000
114 | summary: A0
115 |
116 o changeset: 0:ea207398892e
117 user: test
118 date: Thu Jan 01 00:00:00 1970 +0000
119 summary: ROOT
120
96 121
97 Actual test 122 Actual test
98 ----------- 123 -----------
99 124
125 $ hg debugobshistory 'desc(B0)' --hidden
126 0dec01379d3b (2) B0
127 pruned by test (*20*) (glob)
128 $ hg debugobshistory 'desc(A0)'
129 471f378eab4c (1) A0
100 $ hg up 1 130 $ hg up 1
101 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 131 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg up 0dec01379d3b 132 $ hg up 0dec01379d3b
103 abort: hidden revision '0dec01379d3b'! 133 abort: hidden revision '0dec01379d3b'!
104 (use --hidden to access hidden revisions; pruned) 134 (use --hidden to access hidden revisions; pruned)
193 summary: ROOT 223 summary: ROOT
194 224
195 Actual test 225 Actual test
196 ----------- 226 -----------
197 227
228 $ hg debugobshistory 471597cad322 --hidden
229 471597cad322 (1) A0
230 rewritten by test (*20*) as 337fec4d2edc, f257fde29c7a (glob)
231 $ hg debugobshistory 337fec4d2edc
232 337fec4d2edc (2) A0
233 471597cad322 (1) A0
234 rewritten by test (*20*) as 337fec4d2edc, f257fde29c7a (glob)
235 $ hg debugobshistory f257fde29c7a
236 f257fde29c7a (3) A0
237 471597cad322 (1) A0
238 rewritten by test (*20*) as 337fec4d2edc, f257fde29c7a (glob)
198 $ hg update 471597cad322 239 $ hg update 471597cad322
199 abort: hidden revision '471597cad322'! 240 abort: hidden revision '471597cad322'!
200 (use --hidden to access hidden revisions; successors: 337fec4d2edc, f257fde29c7a) 241 (use --hidden to access hidden revisions; successors: 337fec4d2edc, f257fde29c7a)
201 [255] 242 [255]
202 $ hg update --hidden 'min(desc(A0))' 243 $ hg update --hidden 'min(desc(A0))'
355 summary: ROOT 396 summary: ROOT
356 397
357 Actual test 398 Actual test
358 ----------- 399 -----------
359 400
401 $ hg debugobshistory de7290d8b885 --hidden
402 de7290d8b885 (1) A0
403 rewritten by test (*20*) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a (glob)
404 $ hg debugobshistory c7f044602e9b
405 c7f044602e9b (5) A0
406 de7290d8b885 (1) A0
407 rewritten by test (*20*) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a (glob)
360 $ hg update de7290d8b885 408 $ hg update de7290d8b885
361 abort: hidden revision 'de7290d8b885'! 409 abort: hidden revision 'de7290d8b885'!
362 (use --hidden to access hidden revisions; successors: 337fec4d2edc, f257fde29c7a and 2 more) 410 (use --hidden to access hidden revisions; successors: 337fec4d2edc, f257fde29c7a and 2 more)
363 [255] 411 [255]
364 $ hg update --hidden 'min(desc(A0))' 412 $ hg update --hidden 'min(desc(A0))'
421 summary: ROOT 469 summary: ROOT
422 470
423 Actual test 471 Actual test
424 ----------- 472 -----------
425 473
474 $ hg debugobshistory --hidden 471f378eab4c
475 471f378eab4c (1) A0
476 rewritten by test (*20*) as eb5a0daa2192 (glob)
477 $ hg debugobshistory --hidden 0dec01379d3b
478 0dec01379d3b (2) B0
479 rewritten by test (*20*) as eb5a0daa2192 (glob)
480 $ hg debugobshistory eb5a0daa2192
481 eb5a0daa2192 (3) C0
482 471f378eab4c (1) A0
483 rewritten by test (*20*) as eb5a0daa2192 (glob)
484 0dec01379d3b (2) B0
485 rewritten by test (*20*) as eb5a0daa2192 (glob)
426 $ hg update 471f378eab4c 486 $ hg update 471f378eab4c
427 abort: hidden revision '471f378eab4c'! 487 abort: hidden revision '471f378eab4c'!
428 (use --hidden to access hidden revisions; successor: eb5a0daa2192) 488 (use --hidden to access hidden revisions; successor: eb5a0daa2192)
429 [255] 489 [255]
430 $ hg update --hidden 'desc(A0)' 490 $ hg update --hidden 'desc(A0)'
504 summary: ROOT 564 summary: ROOT
505 565
506 Actual test 566 Actual test
507 ----------- 567 -----------
508 568
569 $ hg debugobshistory --hidden 471f378eab4c
570 471f378eab4c (1) A0
571 rewritten by test (*20*) as 65b757b745b9 (glob)
572 rewritten by test (*20*) as fdf9bde5129a (glob)
573 $ hg debugobshistory fdf9bde5129a
574 fdf9bde5129a (2) A1
575 471f378eab4c (1) A0
576 rewritten by test (*20*) as 65b757b745b9 (glob)
577 rewritten by test (*20*) as fdf9bde5129a (glob)
578 $ hg debugobshistory 65b757b745b9
579 65b757b745b9 (3) A2
580 471f378eab4c (1) A0
581 rewritten by test (*20*) as 65b757b745b9 (glob)
582 rewritten by test (*20*) as fdf9bde5129a (glob)
509 $ hg update 471f378eab4c 583 $ hg update 471f378eab4c
510 abort: hidden revision '471f378eab4c'! 584 abort: hidden revision '471f378eab4c'!
511 (use --hidden to access hidden revisions; diverged) 585 (use --hidden to access hidden revisions; diverged)
512 [255] 586 [255]
513 $ hg update --hidden 'desc(A0)' 587 $ hg update --hidden 'desc(A0)'
514 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 588 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
515 working directory parent is obsolete! (471f378eab4c) 589 working directory parent is obsolete! (471f378eab4c)
516 (471f378eab4c has diverged, use 'hg evolve -list --divergent' to resolve the issue) 590 (471f378eab4c has diverged, use 'hg evolve -list --divergent' to resolve the issue)
591
592 Test output with amended + folded commit
593 ========================================
594
595 Test setup
596 ----------
597
598 $ hg init $TESTTMP/local-amend-fold
599 $ cd $TESTTMP/local-amend-fold
600 $ mkcommit ROOT
601 $ mkcommit A0
602 $ mkcommit B0
603 $ hg amend -m "B1"
604 $ hg log --hidden -G
605 @ changeset: 3:b7ea6d14e664
606 | tag: tip
607 | parent: 1:471f378eab4c
608 | user: test
609 | date: Thu Jan 01 00:00:00 1970 +0000
610 | summary: B1
611 |
612 | x changeset: 2:0dec01379d3b
613 |/ user: test
614 | date: Thu Jan 01 00:00:00 1970 +0000
615 | summary: B0
616 |
617 o changeset: 1:471f378eab4c
618 | user: test
619 | date: Thu Jan 01 00:00:00 1970 +0000
620 | summary: A0
621 |
622 o changeset: 0:ea207398892e
623 user: test
624 date: Thu Jan 01 00:00:00 1970 +0000
625 summary: ROOT
626
627 $ hg fold --exact -r 'desc(A0) + desc(B1)' --date "0 0" -m "C0"
628 2 changesets folded
629 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
630 $ hg log --hidden -G
631 @ changeset: 4:eb5a0daa2192
632 | tag: tip
633 | parent: 0:ea207398892e
634 | user: test
635 | date: Thu Jan 01 00:00:00 1970 +0000
636 | summary: C0
637 |
638 | x changeset: 3:b7ea6d14e664
639 | | parent: 1:471f378eab4c
640 | | user: test
641 | | date: Thu Jan 01 00:00:00 1970 +0000
642 | | summary: B1
643 | |
644 | | x changeset: 2:0dec01379d3b
645 | |/ user: test
646 | | date: Thu Jan 01 00:00:00 1970 +0000
647 | | summary: B0
648 | |
649 | x changeset: 1:471f378eab4c
650 |/ user: test
651 | date: Thu Jan 01 00:00:00 1970 +0000
652 | summary: A0
653 |
654 o changeset: 0:ea207398892e
655 user: test
656 date: Thu Jan 01 00:00:00 1970 +0000
657 summary: ROOT
658
659 Actual test
660 -----------
661
662 $ hg debugobshistory --hidden 471f378eab4c
663 471f378eab4c (1) A0
664 rewritten by test (*20*) as eb5a0daa2192 (glob)
665 $ hg debugobshistory --hidden 0dec01379d3b
666 0dec01379d3b (2) B0
667 rewritten by test (*20*) as b7ea6d14e664 (glob)
668 $ hg debugobshistory eb5a0daa2192
669 eb5a0daa2192 (4) C0
670 b7ea6d14e664 (3) B1
671 rewritten by test (*20*) as eb5a0daa2192 (glob)
672 0dec01379d3b (2) B0
673 rewritten by test (*20*) as b7ea6d14e664 (glob)
674 471f378eab4c (1) A0
675 rewritten by test (*20*) as eb5a0daa2192 (glob)
676 $ hg update 471f378eab4c
677 abort: hidden revision '471f378eab4c'!
678 (use --hidden to access hidden revisions; successor: eb5a0daa2192)
679 [255]
680 $ hg update --hidden 'desc(A0)'
681 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
682 working directory parent is obsolete! (471f378eab4c)
683 (use 'hg evolve' to update to its successor: eb5a0daa2192)
684 $ hg update --hidden 0dec01379d3b
685 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
686 working directory parent is obsolete! (0dec01379d3b)
687 (use 'hg evolve' to update to its successor: eb5a0daa2192)
688 $ hg update 0dec01379d3b
689 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 working directory parent is obsolete! (0dec01379d3b)
691 (use 'hg evolve' to update to its successor: eb5a0daa2192)
692 $ hg update --hidden 'desc(B0)'
693 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 working directory parent is obsolete! (0dec01379d3b)
695 (use 'hg evolve' to update to its successor: eb5a0daa2192)