~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: INADA Naoki
  • Date: 2011-05-17 00:45:09 UTC
  • mfrom: (5875 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5891.
  • Revision ID: songofacandy@gmail.com-20110517004509-q58negjbdjh7t6u1
mergeĀ fromĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    )
22
22
from bzrlib.revision import NULL_REVISION
23
23
from bzrlib.tests import TestCaseWithMemoryTransport
 
24
from bzrlib.symbol_versioning import deprecated_in
24
25
 
25
26
 
26
27
# Ancestry 1:
1646
1647
        self.assertEqual(['B', 'D'],
1647
1648
            sorted(graph_thunk.heads(['D', 'B', 'A'])))
1648
1649
 
1649
 
    def test_merge_sort(self):
1650
 
        d = {('C',):[('A',)], ('B',): [('A',)], ('A',): []}
1651
 
        g = _mod_graph.KnownGraph(d)
1652
 
        graph_thunk = _mod_graph.GraphThunkIdsToKeys(g)
1653
 
        graph_thunk.add_node("D", ["A", "C"])
1654
 
        self.assertEqual([('C', 0, (2,), False), ('A', 0, (1,), True)],
1655
 
            [(n.key, n.merge_depth, n.revno, n.end_of_merge)
1656
 
                 for n in graph_thunk.merge_sort('C')])
1657
 
 
1658
1650
 
1659
1651
class TestPendingAncestryResultGetKeys(TestCaseWithMemoryTransport):
1660
1652
    """Tests for bzrlib.graph.PendingAncestryResult."""