1726
1726
def assertLogRevnos(self, expected_revnos, b, start, end,
1727
exclude_common_ancestry):
1727
exclude_common_ancestry, generate_merge_revisions=True):
1728
1728
# FIXME: the layering in log makes it hard to test intermediate levels,
1729
1729
# I wish adding filters with their parameters were easier...
1730
1730
# -- vila 20100413
1731
1731
iter_revs = log._calc_view_revisions(
1732
1732
b, start, end, direction='reverse',
1733
generate_merge_revisions=True,
1733
generate_merge_revisions=generate_merge_revisions,
1734
1734
exclude_common_ancestry=exclude_common_ancestry)
1735
1735
self.assertEqual(expected_revnos,
1736
1736
[revid for revid, revno, depth in iter_revs])
1738
1738
def test_merge_sorted_exclude_ancestry(self):
1739
1739
b = self.make_branch_with_alternate_ancestries()
1740
1740
self.assertLogRevnos(['3', '1.1.2', '1.2.1', '1.1.1', '2', '1'],
1741
b, '1', '3', exclude_common_ancestry=False)
1742
1742
# '2' is part of the '3' ancestry but not part of '1.1.1' ancestry so
1743
1743
# it should be mentioned even if merge_sort order will make it appear
1745
1745
self.assertLogRevnos(['3', '1.1.2', '1.2.1', '2'],
1746
b, '1.1.1', '3', True)
1746
b, '1.1.1', '3', exclude_common_ancestry=True)
1748
def test_merge_sorted_simple_revnos_exclude_ancestry(self):
1749
b = self.make_branch_with_alternate_ancestries()
1750
self.assertLogRevnos(['3', '2'],
1751
b, '1', '3', exclude_common_ancestry=True,
1752
generate_merge_revisions=False)
1753
self.assertLogRevnos(['3', '1.1.2', '1.2.1', '1.1.1', '2'],
1754
b, '1', '3', exclude_common_ancestry=True,
1755
generate_merge_revisions=True)