##// END OF EJS Templates
evolution: stop wrongly flagging unrelated part of a split as divergent...
marmoute -
r53029:e68fe567 stable
parent child Browse files
Show More
@@ -1030,7 +1030,9 b' def _computecontentdivergentset(repo):'
1030 if prec not in newermap:
1030 if prec not in newermap:
1031 obsutil.successorssets(repo, prec, cache=newermap)
1031 obsutil.successorssets(repo, prec, cache=newermap)
1032 newer = [n for n in newermap[prec] if n]
1032 newer = [n for n in newermap[prec] if n]
1033 if len(newer) > 1:
1033 # Strickly speaking, the len(newer) is not needed, but it speeds
1034 # things up.
1035 if len(newer) > 1 and any(n for n in newer if node not in n):
1034 divergent.add(rev)
1036 divergent.add(rev)
1035 break
1037 break
1036 toprocess.update(obsstore.predecessors.get(prec, ()))
1038 toprocess.update(obsstore.predecessors.get(prec, ()))
@@ -2304,7 +2304,7 b' Diverge one of the splitted commit'
2304 $ hg up 6 --hidden
2304 $ hg up 6 --hidden
2305 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2305 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2306 $ hg commit --amend -m "Add B only"
2306 $ hg commit --amend -m "Add B only"
2307 4 new content-divergent changesets
2307 2 new content-divergent changesets
2308
2308
2309 $ hg log -G
2309 $ hg log -G
2310 @ changeset: 9:0b997eb7ceee
2310 @ changeset: 9:0b997eb7ceee
@@ -2325,7 +2325,7 b' Diverge one of the splitted commit'
2325 | * changeset: 7:ba2ed02b0c9a
2325 | * changeset: 7:ba2ed02b0c9a
2326 | | user: test
2326 | | user: test
2327 | | date: Thu Jan 01 00:00:00 1970 +0000
2327 | | date: Thu Jan 01 00:00:00 1970 +0000
2328 | | instability: orphan, content-divergent
2328 | | instability: orphan
2329 | | summary: Add A,B,C
2329 | | summary: Add A,B,C
2330 | |
2330 | |
2331 | x changeset: 6:4a004186e638
2331 | x changeset: 6:4a004186e638
@@ -2335,11 +2335,10 b' Diverge one of the splitted commit'
2335 | obsolete: rewritten using amend as 9:0b997eb7ceee
2335 | obsolete: rewritten using amend as 9:0b997eb7ceee
2336 | summary: Add A,B,C
2336 | summary: Add A,B,C
2337 |
2337 |
2338 * changeset: 5:dd800401bd8c
2338 o changeset: 5:dd800401bd8c
2339 | parent: 3:f897c6137566
2339 | parent: 3:f897c6137566
2340 | user: test
2340 | user: test
2341 | date: Thu Jan 01 00:00:00 1970 +0000
2341 | date: Thu Jan 01 00:00:00 1970 +0000
2342 | instability: content-divergent
2343 | summary: Add A,B,C
2342 | summary: Add A,B,C
2344 |
2343 |
2345 o changeset: 3:f897c6137566
2344 o changeset: 3:f897c6137566
@@ -2391,7 +2390,7 b' Check templates'
2391 | multi-line: 8:b18bc8331526
2390 | multi-line: 8:b18bc8331526
2392 | multi-line: 9:0b997eb7ceee
2391 | multi-line: 9:0b997eb7ceee
2393 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2392 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2394 * dd800401bd8c
2393 o dd800401bd8c
2395 | Predecessors:
2394 | Predecessors:
2396 | semi-colon:
2395 | semi-colon:
2397 | json: []
2396 | json: []
@@ -2424,7 +2423,7 b' Check templates'
2424 | |
2423 | |
2425 | x 4a004186e638
2424 | x 4a004186e638
2426 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2425 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2427 * dd800401bd8c
2426 o dd800401bd8c
2428 |
2427 |
2429 o f897c6137566
2428 o f897c6137566
2430 |
2429 |
@@ -2464,7 +2463,7 b' Check templates'
2464 | multi-line: 8:b18bc8331526
2463 | multi-line: 8:b18bc8331526
2465 | multi-line: 9:0b997eb7ceee
2464 | multi-line: 9:0b997eb7ceee
2466 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2465 | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
2467 * dd800401bd8c
2466 o dd800401bd8c
2468 | Predecessors: 4:9bd10a0775e4
2467 | Predecessors: 4:9bd10a0775e4
2469 | semi-colon: 4:9bd10a0775e4
2468 | semi-colon: 4:9bd10a0775e4
2470 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2469 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2522,7 +2521,7 b' Check templates'
2522 | |
2521 | |
2523 | x 4a004186e638
2522 | x 4a004186e638
2524 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2523 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
2525 * dd800401bd8c
2524 o dd800401bd8c
2526 |
2525 |
2527 | x 9bd10a0775e4
2526 | x 9bd10a0775e4
2528 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000);
2527 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000);
@@ -2543,7 +2542,7 b' Check templates'
2543 | |
2542 | |
2544 | x 4a004186e638
2543 | x 4a004186e638
2545 |/ Obsfate: [{"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["b18bc8331526a22cbb1801022bd1555bf291c48b"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b18bc8331526a22cbb1801022bd1555bf291c48b"]}, {"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["0b997eb7ceeee06200a02f8aab185979092d514e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["0b997eb7ceeee06200a02f8aab185979092d514e"]}]
2544 |/ Obsfate: [{"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["b18bc8331526a22cbb1801022bd1555bf291c48b"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b18bc8331526a22cbb1801022bd1555bf291c48b"]}, {"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["0b997eb7ceeee06200a02f8aab185979092d514e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["0b997eb7ceeee06200a02f8aab185979092d514e"]}]
2546 * dd800401bd8c
2545 o dd800401bd8c
2547 |
2546 |
2548 | x 9bd10a0775e4
2547 | x 9bd10a0775e4
2549 |/ Obsfate: [{"markers": [["9bd10a0775e478708cada5f176ec6de654359ce7", ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]}]
2548 |/ Obsfate: [{"markers": [["9bd10a0775e478708cada5f176ec6de654359ce7", ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]}]
@@ -2562,7 +2561,7 b' Check templates'
2562 $ hg rebase -r 7 -d 8 --config extensions.rebase=
2561 $ hg rebase -r 7 -d 8 --config extensions.rebase=
2563 rebasing 7:ba2ed02b0c9a "Add A,B,C"
2562 rebasing 7:ba2ed02b0c9a "Add A,B,C"
2564 $ hg tlog
2563 $ hg tlog
2565 * eceed8f98ffc
2564 o eceed8f98ffc
2566 | Predecessors: 4:9bd10a0775e4
2565 | Predecessors: 4:9bd10a0775e4
2567 | semi-colon: 4:9bd10a0775e4
2566 | semi-colon: 4:9bd10a0775e4
2568 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2567 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2586,7 +2585,7 b' Check templates'
2586 | Successors:
2585 | Successors:
2587 | multi-line:
2586 | multi-line:
2588 | json: []
2587 | json: []
2589 * dd800401bd8c
2588 o dd800401bd8c
2590 | Predecessors: 4:9bd10a0775e4
2589 | Predecessors: 4:9bd10a0775e4
2591 | semi-colon: 4:9bd10a0775e4
2590 | semi-colon: 4:9bd10a0775e4
2592 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
2591 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2621,13 +2620,13 b' Check templates'
2621 json: []
2620 json: []
2622
2621
2623 $ hg fatelog
2622 $ hg fatelog
2624 * eceed8f98ffc
2623 o eceed8f98ffc
2625 |
2624 |
2626 | * 0b997eb7ceee
2625 | * 0b997eb7ceee
2627 | |
2626 | |
2628 * | b18bc8331526
2627 * | b18bc8331526
2629 |/
2628 |/
2630 * dd800401bd8c
2629 o dd800401bd8c
2631 |
2630 |
2632 | @ 9bd10a0775e4
2631 | @ 9bd10a0775e4
2633 |/ Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000);
2632 |/ Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000);
@@ -2639,7 +2638,7 b' Check other fatelog implementations'
2639 -----------------------------------
2638 -----------------------------------
2640
2639
2641 $ hg fatelogkw --hidden -q
2640 $ hg fatelogkw --hidden -q
2642 * eceed8f98ffc
2641 o eceed8f98ffc
2643 |
2642 |
2644 | * 0b997eb7ceee
2643 | * 0b997eb7ceee
2645 | |
2644 | |
@@ -2650,7 +2649,7 b' Check other fatelog implementations'
2650 | x 4a004186e638
2649 | x 4a004186e638
2651 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2650 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2652 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2651 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2653 * dd800401bd8c
2652 o dd800401bd8c
2654 |
2653 |
2655 | @ 9bd10a0775e4
2654 | @ 9bd10a0775e4
2656 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
2655 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
@@ -2664,7 +2663,7 b' Check other fatelog implementations'
2664 o ea207398892e
2663 o ea207398892e
2665
2664
2666 $ hg fatelogkw --hidden
2665 $ hg fatelogkw --hidden
2667 * eceed8f98ffc
2666 o eceed8f98ffc
2668 |
2667 |
2669 | * 0b997eb7ceee
2668 | * 0b997eb7ceee
2670 | |
2669 | |
@@ -2675,7 +2674,7 b' Check other fatelog implementations'
2675 | x 4a004186e638
2674 | x 4a004186e638
2676 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2675 |/ Obsfate: rewritten using amend as 8:b18bc8331526
2677 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2676 | Obsfate: rewritten using amend as 9:0b997eb7ceee
2678 * dd800401bd8c
2677 o dd800401bd8c
2679 |
2678 |
2680 | @ 9bd10a0775e4
2679 | @ 9bd10a0775e4
2681 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
2680 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
@@ -2689,7 +2688,7 b' Check other fatelog implementations'
2689 o ea207398892e
2688 o ea207398892e
2690
2689
2691 $ hg fatelogkw --hidden -v
2690 $ hg fatelogkw --hidden -v
2692 * eceed8f98ffc
2691 o eceed8f98ffc
2693 |
2692 |
2694 | * 0b997eb7ceee
2693 | * 0b997eb7ceee
2695 | |
2694 | |
@@ -2700,7 +2699,7 b' Check other fatelog implementations'
2700 | x 4a004186e638
2699 | x 4a004186e638
2701 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000)
2700 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000)
2702 | Obsfate: rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000)
2701 | Obsfate: rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000)
2703 * dd800401bd8c
2702 o dd800401bd8c
2704 |
2703 |
2705 | @ 9bd10a0775e4
2704 | @ 9bd10a0775e4
2706 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000)
2705 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000)
@@ -2714,12 +2713,11 b' Check other fatelog implementations'
2714 o ea207398892e
2713 o ea207398892e
2715
2714
2716 $ hg log -G -T "default" --hidden
2715 $ hg log -G -T "default" --hidden
2717 * changeset: 10:eceed8f98ffc
2716 o changeset: 10:eceed8f98ffc
2718 | tag: tip
2717 | tag: tip
2719 | parent: 8:b18bc8331526
2718 | parent: 8:b18bc8331526
2720 | user: test
2719 | user: test
2721 | date: Thu Jan 01 00:00:00 1970 +0000
2720 | date: Thu Jan 01 00:00:00 1970 +0000
2722 | instability: content-divergent
2723 | summary: Add A,B,C
2721 | summary: Add A,B,C
2724 |
2722 |
2725 | * changeset: 9:0b997eb7ceee
2723 | * changeset: 9:0b997eb7ceee
@@ -2749,11 +2747,10 b' Check other fatelog implementations'
2749 | obsolete: rewritten using amend as 9:0b997eb7ceee
2747 | obsolete: rewritten using amend as 9:0b997eb7ceee
2750 | summary: Add A,B,C
2748 | summary: Add A,B,C
2751 |
2749 |
2752 * changeset: 5:dd800401bd8c
2750 o changeset: 5:dd800401bd8c
2753 | parent: 3:f897c6137566
2751 | parent: 3:f897c6137566
2754 | user: test
2752 | user: test
2755 | date: Thu Jan 01 00:00:00 1970 +0000
2753 | date: Thu Jan 01 00:00:00 1970 +0000
2756 | instability: content-divergent
2757 | summary: Add A,B,C
2754 | summary: Add A,B,C
2758 |
2755 |
2759 | @ changeset: 4:9bd10a0775e4
2756 | @ changeset: 4:9bd10a0775e4
@@ -466,7 +466,7 b' Check more complex obsolescence graft (w'
466 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
466 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
467 $ hg debugobsolete `getid A_5` `getid A_9`
467 $ hg debugobsolete `getid A_5` `getid A_9`
468 1 new obsolescence markers
468 1 new obsolescence markers
469 4 new content-divergent changesets
469 3 new content-divergent changesets
470 $ hg log -G --hidden
470 $ hg log -G --hidden
471 * 10:bed64f5d2f5a A_9
471 * 10:bed64f5d2f5a A_9
472 |
472 |
@@ -480,7 +480,7 b' Check more complex obsolescence graft (w'
480 |/
480 |/
481 | x 5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690]
481 | x 5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690]
482 |/
482 |/
483 | * 4:01f36c5a8fda A_3
483 | o 4:01f36c5a8fda A_3
484 |/
484 |/
485 | x 3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a]
485 | x 3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a]
486 |/
486 |/
@@ -553,7 +553,6 b' Check more complex obsolescence graft (w'
553 bed64f5d2f5a
553 bed64f5d2f5a
554 bed64f5d2f5a
554 bed64f5d2f5a
555 $ hg log -r 'contentdivergent()'
555 $ hg log -r 'contentdivergent()'
556 4:01f36c5a8fda A_3
557 8:7ae126973a96 A_7
556 8:7ae126973a96 A_7
558 9:14608b260df8 A_8
557 9:14608b260df8 A_8
559 10:bed64f5d2f5a A_9
558 10:bed64f5d2f5a A_9
@@ -719,7 +718,58 b' successors-set. (report [A,B] not [A] + '
719
718
720 $ cd ..
719 $ cd ..
721
720
721 Divergence introduced after a split
722 -----------------------------------
723
724 Make sure divergence introduced in sucessors of a split does not spill to the
725 unrelated part.
726
727 $ newcase split-unrelated-branch
728 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
729 1 new obsolescence markers
730 obsoleted 1 changesets
731 $ hg up 'desc("A_2")'
732 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
733 $ hg commit --amend -m "A_3"
734 $ hg up 'desc("A_2")' --hidden
735 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 updated to hidden changeset 392fd25390da
737 (hidden revision '392fd25390da' was rewritten as: 4d672202d2fb)
738 $ hg commit --amend -m "A_4" --config experimental.evolution.allowdivergence=yes
739 2 new content-divergent changesets
740 $ hg log -G --hidden
741 @ 5:6730f214b07b A_4
742 |
743 | * 4:4d672202d2fb A_3
744 |/
745 | x 3:392fd25390da A_2 [rewritten using amend as 5:6730f214b07b; rewritten using amend as 4:4d672202d2fb]
746 |/
747 | o 2:82623d38b9ba A_1
748 |/
749 | x 1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da]
750 |/
751 o 0:d20a80d4def3 base
752
753 $ hg debugsuccessorssets --hidden 'desc('A_0')'
754 007dc284c1f8
755 82623d38b9ba 4d672202d2fb
756 82623d38b9ba 6730f214b07b
757 $ hg debugsuccessorssets --hidden 'desc('A_1')'
758 82623d38b9ba
759 82623d38b9ba
760 $ hg debugsuccessorssets --hidden 'desc('A_2')'
761 392fd25390da
762 6730f214b07b
763 4d672202d2fb
764 $ hg log -r 'contentdivergent()'
765 4:4d672202d2fb A_3
766 5:6730f214b07b A_4
767 $ cd ..
768
769
770
722 Use scmutil.cleanupnodes API to create divergence
771 Use scmutil.cleanupnodes API to create divergence
772 =================================================
723
773
724 $ hg init cleanupnodes
774 $ hg init cleanupnodes
725 $ cd cleanupnodes
775 $ cd cleanupnodes
General Comments 0
You need to be logged in to leave comments. Login now