/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-14 16:38:06 UTC
  • mto: This revision was merged to the branch mainline in revision 5190.
  • Revision ID: v.ladeuil+lp@free.fr-20100414163806-8ity266y0gf5f7mv
Fix the performance by finding the relevant subgraph once.

* bzrlib/branch.py:
(Branch._filter_merge_sorted_revisions): Calculate the graph
difference once.

* bzrlib/tests/test_log.py:
(TestLogExcludeAncestry.make_branch_with_alternate_ancestries):
Make the test more obvious.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1549
1549
        builder = branchbuilder.BranchBuilder(self.get_transport(relpath))
1550
1550
        # 1
1551
1551
        # |\
1552
 
        # | 1.1.1
1553
 
        # | /| \
1554
 
        # 2  |  |
 
1552
        # 2 \
 
1553
        # |  |
 
1554
        # |  1.1.1
 
1555
        # |  | \
1555
1556
        # |  |  1.2.1
1556
1557
        # |  | /
1557
1558
        # |  1.1.2
1561
1562
        builder.build_snapshot('1', None, [
1562
1563
            ('add', ('', 'TREE_ROOT', 'directory', '')),])
1563
1564
        builder.build_snapshot('1.1.1', ['1'], [])
1564
 
        builder.build_snapshot('2', ['1', '1.1.1'], [])
 
1565
        builder.build_snapshot('2', ['1'], [])
1565
1566
        builder.build_snapshot('1.2.1', ['1.1.1'], [])
1566
1567
        builder.build_snapshot('1.1.2', ['1.1.1', '1.2.1'], [])
1567
1568
        builder.build_snapshot('3', ['2', '1.1.2'], [])
1585
1586
 
1586
1587
    def test_merge_sorted_exclude_ancestry(self):
1587
1588
        b = self.make_branch_with_alternate_ancestries()
1588
 
        self.assertLogRevnos(['3', '1.1.2', '1.2.1', '2', '1.1.1', '1'],
 
1589
        self.assertLogRevnos(['3', '1.1.2', '1.2.1', '1.1.1', '2', '1'],
1589
1590
                             b, '1', '3', False)
1590
 
        self.assertLogRevnos(['1.1.2', '1.2.1'],
1591
 
                             b, '1.1.1', '1.1.2', True)
 
1591
        self.assertLogRevnos(['3', '1.1.2', '1.2.1', '2'],
 
1592
                             b, '1.1.1', '3', True)
1592
1593
 
1593
1594