comparison tests/test-annotate.t @ 33284:b2670290eab4

followlines: join merge parents line ranges in blockdescendants() (issue5595) In blockdescendants(), we had an assertion when line range of a merge changeset was not consistent depending on which parent was considered for computation. For instance, this might occur when file content (in lookup range) is significantly different between parent branches of the merge as demonstrated in added tests (where we almost completely rewrite the "baz" file while also introducing similarities with its content in the other branch we later merge to). Now, in such case, we combine line ranges from all parents by storing the envelope of both line ranges. This is conservative (the line range is extended, possibly unnecessarily) but at least this should avoid missing descendants with changes in a range that would fall in that of one parent but not in another one (the case of "baz: narrow change (2->2+)" changeset in tests).
author Denis Laxalde <denis.laxalde@logilab.fr>
date Wed, 05 Jul 2017 13:54:53 +0200
parents e5dd44f78ac6
children 1a4eca3b12dd
comparison
equal deleted inserted replaced
33283:634b259079c5 33284:b2670290eab4
722 o 18: baz:2 722 o 18: baz:2
723 : 723 :
724 o 16: baz:0 724 o 16: baz:0
725 | 725 |
726 ~ 726 ~
727
728 Issue5595: on a merge changeset with different line ranges depending on
729 parent, be conservative and use the surrounding interval to avoid loosing
730 track of possible further descendants in specified range.
731
732 $ hg up 23 --quiet
733 $ hg cat baz -r 24
734 0
735 0
736 1 baz:1
737 2 baz:2
738 3+ baz:3
739 4 baz:4
740 5
741 6
742 $ cat > baz << EOF
743 > 0
744 > 0
745 > a
746 > b
747 > 3+ baz:3
748 > 4 baz:4
749 > y
750 > z
751 > EOF
752 $ hg ci -m 'baz: mostly rewrite with some content from 24'
753 created new head
754 $ hg merge --tool :merge-other 24
755 merging baz
756 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
757 (branch merge, don't forget to commit)
758 $ hg ci -m 'merge forgetting about baz rewrite'
759 $ cat > baz << EOF
760 > 0
761 > 0
762 > 1 baz:1
763 > 2+ baz:2
764 > 3+ baz:3
765 > 4 baz:4
766 > 5
767 > 6
768 > EOF
769 $ hg ci -m 'baz: narrow change (2->2+)'
770 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:4, startrev=20, descend=True)' --graph
771 @ 33: baz: narrow change (2->2+)
772 |
773 o 32: merge forgetting about baz rewrite
774 |\
775 | o 31: baz: mostly rewrite with some content from 24
776 | :
777 | : o 30: baz:3->+3
778 | :/
779 +---o 27: baz:3+->3-
780 | :
781 o : 24: baz:3->3+
782 :/
783 o 20: baz:4
784 |\
785 ~ ~
727 786
728 check error cases 787 check error cases
729 $ hg up 24 --quiet 788 $ hg up 24 --quiet
730 $ hg log -r 'followlines()' 789 $ hg log -r 'followlines()'
731 hg: parse error: followlines takes at least 1 positional arguments 790 hg: parse error: followlines takes at least 1 positional arguments