~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Aaron Bentley
  • Date: 2010-08-15 15:20:14 UTC
  • mto: (5365.6.7 annotate-revspec)
  • mto: This revision was merged to the branch mainline in revision 5443.
  • Revision ID: aaron@aaronbentley.com-20100815152014-vlnikxr8mhkxwiga
Implement find_lefthand_merger.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1442
1442
        descendants = graph.find_descendants('rev2a', 'rev4')
1443
1443
        self.assertEqual(set(['rev2a', 'rev3', 'rev4']), descendants)
1444
1444
 
 
1445
class TestFindLefthandMerger(TestGraphBase):
 
1446
 
 
1447
    def check_merger(self, result, ancestry, merged, tip):
 
1448
        graph = self.make_graph(ancestry)
 
1449
        self.assertEqual(result, graph.find_lefthand_merger(merged, tip))
 
1450
 
 
1451
    def test_find_lefthand_merger_rev2b(self):
 
1452
        self.check_merger('rev4', ancestry_1, 'rev2b', 'rev4')
 
1453
 
 
1454
    def test_find_lefthand_merger_rev2a(self):
 
1455
        self.check_merger('rev2a', ancestry_1, 'rev2a', 'rev4')
 
1456
 
 
1457
    def test_find_lefthand_merger_rev4(self):
 
1458
        self.check_merger(None, ancestry_1, 'rev4', 'rev2a')
 
1459
 
 
1460
    def test_find_lefthand_merger_f(self):
 
1461
        self.check_merger('i', complex_shortcut, 'f', 'm')
 
1462
 
 
1463
    def test_find_lefthand_merger_g(self):
 
1464
        self.check_merger('i', complex_shortcut, 'g', 'm')
 
1465
 
 
1466
    def test_find_lefthand_merger_h(self):
 
1467
        self.check_merger('n', complex_shortcut, 'h', 'n')
 
1468
 
1445
1469
 
1446
1470
class TestGetChildMap(TestGraphBase):
1447
1471