/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_graph.py

merge bzr.dev rev 4098

Show diffs side-by-side

added added

removed removed

Lines of Context:
1080
1080
        search = graph._make_breadth_first_searcher(['head'])
1081
1081
        expected = [
1082
1082
            # NULL_REVISION and ghost1 have not been returned
1083
 
            (set(['head']), (set(['head']), set(['child', 'ghost1']), 1),
 
1083
            (set(['head']),
 
1084
             (set(['head']), set(['child', NULL_REVISION, 'ghost1']), 1),
1084
1085
             ['head'], None, [NULL_REVISION, 'ghost1']),
1085
1086
            # ghost1 has been returned, NULL_REVISION is to be returned in the
1086
1087
            # next iteration.
1524
1525
        # 2 and 3 cannot be removed because 1 has 2 parents
1525
1526
        d = {1:[2, 3], 2:[4], 4:[6], 3:[5], 5:[6], 6:[7], 7:[]}
1526
1527
        self.assertCollapsed(d, d)
 
1528
 
 
1529
 
 
1530
class TestPendingAncestryResult(TestCaseWithMemoryTransport):
 
1531
    """Tests for bzrlib.graph.PendingAncestryResult."""
 
1532
 
 
1533
    def test_get_keys(self):
 
1534
        builder = self.make_branch_builder('b')
 
1535
        builder.start_series()
 
1536
        builder.build_snapshot('rev-1', None, [
 
1537
            ('add', ('', 'root-id', 'directory', ''))])
 
1538
        builder.build_snapshot('rev-2', ['rev-1'], [])
 
1539
        builder.finish_series()
 
1540
        repo = builder.get_branch().repository
 
1541
        repo.lock_read()
 
1542
        self.addCleanup(repo.unlock)
 
1543
        par = _mod_graph.PendingAncestryResult(['rev-2'], repo)
 
1544
        self.assertEqual(set(['rev-1', 'rev-2']), set(par.get_keys()))
 
1545