##// END OF EJS Templates
followlines: join merge parents line ranges in blockdescendants() (issue5595)...
Denis Laxalde -
r33284:b2670290 default
parent child Browse files
Show More
@@ -287,12 +287,13 b' def blockdescendants(fctx, fromline, tol'
287 continue
287 continue
288 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts)
288 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts)
289 inrange = inrange or inrangep
289 inrange = inrange or inrangep
290 # If revision 'i' has been seen (it's a merge), we assume that its
290 # If revision 'i' has been seen (it's a merge) and the line range
291 # line range is the same independently of which parents was used
291 # previously computed differs from the one we just got, we take the
292 # to compute it.
292 # surrounding interval. This is conservative but avoids loosing
293 assert i not in seen or seen[i][1] == linerange1, (
293 # information.
294 'computed line range for %s is not consistent between '
294 if i in seen and seen[i][1] != linerange1:
295 'ancestor branches' % c)
295 lbs, ubs = zip(linerange1, seen[i][1])
296 linerange1 = min(lbs), max(ubs)
296 seen[i] = c, linerange1
297 seen[i] = c, linerange1
297 if inrange:
298 if inrange:
298 yield c, linerange1
299 yield c, linerange1
@@ -725,6 +725,65 b' we follow all branches in descending dir'
725 |
725 |
726 ~
726 ~
727
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 ~ ~
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()'
General Comments 0
You need to be logged in to leave comments. Login now