~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Alexander Belchenko
  • Date: 2010-06-17 08:53:15 UTC
  • mfrom: (5300 +trunk)
  • mto: (5303.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5305.
  • Revision ID: bialix@ukr.net-20100617085315-hr8186zck57zn35s
merge bzr.dev; fix NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1724
1724
        return br
1725
1725
 
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', False)
 
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
1744
1744
        # after 1.1.1
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)
1747
1747
 
 
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)
1748
1756