~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Martin Pool
  • Date: 2011-06-28 17:25:26 UTC
  • mfrom: (5999 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110628172526-10cok2s17dvw7x62
merge news

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
25
24
 
26
25
 
27
26
# Ancestry 1:
1647
1646
        self.assertEqual(['B', 'D'],
1648
1647
            sorted(graph_thunk.heads(['D', 'B', 'A'])))
1649
1648
 
 
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
 
1650
1658
 
1651
1659
class TestPendingAncestryResultGetKeys(TestCaseWithMemoryTransport):
1652
1660
    """Tests for bzrlib.graph.PendingAncestryResult."""