/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

  • Committer: Martin Pool
  • Date: 2009-03-03 03:01:49 UTC
  • mfrom: (4070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4073.
  • Revision ID: mbp@sourcefrog.net-20090303030149-8p8o8hszdtqa7w8f
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
                    'e':['d'], 'f':['e'], 'g':['f'], 'h':['d'], 'i':['g'],
238
238
                    'j':['h'], 'k':['h', 'i'], 'l':['k'], 'm':['l'], 'n':['m'],
239
239
                    'o':['n'], 'p':['o'], 'q':['p'], 'r':['q'], 's':['r'],
240
 
                    't':['i', 's'], 'u':['s', 'j'], 
 
240
                    't':['i', 's'], 'u':['s', 'j'],
241
241
                    }
242
242
 
243
243
# Graph where different walkers will race to find the common and uncommon
711
711
 
712
712
    def test_is_ancestor_boundary(self):
713
713
        """Ensure that we avoid searching the whole graph.
714
 
        
 
714
 
715
715
        This requires searching through b as a common ancestor, so we
716
716
        can identify that e is common.
717
717
        """
737
737
        # 'a' is not in the ancestry of 'c', and 'g' is a ghost
738
738
        expected['g'] = None
739
739
        self.assertEqual(expected, dict(graph.iter_ancestry(['a', 'c'])))
740
 
        expected.pop('a') 
 
740
        expected.pop('a')
741
741
        self.assertEqual(expected, dict(graph.iter_ancestry(['c'])))
742
742
 
743
743
    def test_filter_candidate_lca(self):
845
845
 
846
846
    def _run_heads_break_deeper(self, graph_dict, search):
847
847
        """Run heads on a graph-as-a-dict.
848
 
        
 
848
 
849
849
        If the search asks for the parents of 'deeper' the test will fail.
850
850
        """
851
851
        class stub(object):
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.