comparison tests/test-evolve-content-divergence.t @ 4408:02ece0e5865e

evolve: fix the broken behaviour on div resolution in relocation case In content divergence resolution, I see that when "relocationreq" is True which means both the cset are on different parent and relocation is required. In this case when "divergent" is the one who is behind the "other" cset in DAG, we swap them. At this point one thing we missed is to update the evolvestate['divergent']. Because of this in continue case we didn't get the right value of obsmarkers creation. In this patch I added the code to update the evolvestate when we swap them. Now as we know "divergent" and "other" can be swapped in some cases, it is better to store the intial divergent separately in evolvestate which is evolvestate['orig-divergent'] and later this value is used to update the evolvestate['replacements'] which is the track of revisions which has been resolved. Changes in tests demonstrate the fixed behaviour.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 22 Feb 2019 21:01:06 +0530
parents 7fd0cbf6190d
children 62a6f8f4e694
comparison
equal deleted inserted replaced
4407:7fd0cbf6190d 4408:02ece0e5865e
691 (no more unresolved files) 691 (no more unresolved files)
692 continue: hg evolve --continue 692 continue: hg evolve --continue
693 693
694 $ hg evolve --continue 694 $ hg evolve --continue
695 evolving 23:3f7a1f693080 "added z" 695 evolving 23:3f7a1f693080 "added z"
696 updating to "local" side of the conflict: 3f7a1f693080 696 updating to "local" side of the conflict: 53242575ffa9
697 merging "other" content-divergent changeset 'cdb0643c69fc' 697 merging "other" content-divergent changeset 'cdb0643c69fc'
698 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 698 merging y
699 working directory is now at 10c9f94f1e99 699 warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
700 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
701 fix conflicts and see `hg help evolve.interrupted`
702 [1]
700 703
701 $ hg diff 704 $ hg diff
705 diff -r 53242575ffa9 y
706 --- a/y Thu Jan 01 00:00:00 1970 +0000
707 +++ b/y Thu Jan 01 00:00:00 1970 +0000
708 @@ -1,1 +1,5 @@
709 +<<<<<<< local: 53242575ffa9 bar - test: added z
710 watbar
711 +=======
712 +foo
713 +>>>>>>> other: cdb0643c69fc - test: added z
702 714
703 $ echo foo > y 715 $ echo foo > y
704 $ hg resolve -m 716 $ hg resolve -m
705 abort: resolve command not applicable when not merging 717 (no more unresolved files)
706 [255] 718 continue: hg evolve --continue
707 $ hg evolve --continue 719 $ hg evolve --continue
708 abort: no interrupted evolve to continue 720 working directory is now at 6fc7d9682de6
709 [255] 721
710 722 $ hg glog
711 $ hg glog 723 @ 27:6fc7d9682de6 added z
712 @ 27:10c9f94f1e99 added z 724 | () [bar] draft
713 | () [default] draft
714 | * 25:53242575ffa9 added z
715 |/ () [bar] draft
716 o 21:7bbcf24ddecf added y 725 o 21:7bbcf24ddecf added y
717 | () [bar] draft 726 | () [bar] draft
718 o 15:b006cf317e0e added foo to x 727 o 15:b006cf317e0e added foo to x
719 | () [bar] draft 728 | () [bar] draft
720 o 10:4ae4427ee9f8 added d 729 o 10:4ae4427ee9f8 added d
731 $ hg exp 740 $ hg exp
732 # HG changeset patch 741 # HG changeset patch
733 # User test 742 # User test
734 # Date 0 0 743 # Date 0 0
735 # Thu Jan 01 00:00:00 1970 +0000 744 # Thu Jan 01 00:00:00 1970 +0000
736 # Node ID 10c9f94f1e9902d905b22019d711d31f3642f589 745 # Branch bar
746 # Node ID 6fc7d9682de6e3bee6c8b1266b756ed7d522b7e4
737 # Parent 7bbcf24ddecfe97d7c2ac6fa8c07c155c8fda47b 747 # Parent 7bbcf24ddecfe97d7c2ac6fa8c07c155c8fda47b
738 added z 748 added z
739 749
740 diff -r 7bbcf24ddecf -r 10c9f94f1e99 y 750 diff -r 7bbcf24ddecf -r 6fc7d9682de6 y
741 --- a/y Thu Jan 01 00:00:00 1970 +0000 751 --- a/y Thu Jan 01 00:00:00 1970 +0000
742 +++ b/y Thu Jan 01 00:00:00 1970 +0000 752 +++ b/y Thu Jan 01 00:00:00 1970 +0000
743 @@ -1,1 +1,1 @@ 753 @@ -1,1 +1,1 @@
744 -watbar 754 -watbar
745 +foo 755 +foo
746 diff -r 7bbcf24ddecf -r 10c9f94f1e99 z 756 diff -r 7bbcf24ddecf -r 6fc7d9682de6 z
747 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 757 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
748 +++ b/z Thu Jan 01 00:00:00 1970 +0000 758 +++ b/z Thu Jan 01 00:00:00 1970 +0000
749 @@ -0,0 +1,1 @@ 759 @@ -0,0 +1,1 @@
750 +z 760 +bar
751 761
752 $ cd .. 762 $ cd ..
753 763
754 Resolving content-divergence of a stack with same parents 764 Resolving content-divergence of a stack with same parents
755 --------------------------------------------------------- 765 ---------------------------------------------------------