/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/per_repository/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2010-04-10 01:22:00 UTC
  • mto: This revision was merged to the branch mainline in revision 5143.
  • Revision ID: jelmer@samba.org-20100410012200-y089oi8jwvx9khyh
Add test for Repository.get_known_graph_ancestry().

Show diffs side-by-side

added added

removed removed

Lines of Context:
724
724
        self.assertTrue('ghost' not in parents)
725
725
        self.assertEqual(parents['rev2'], ('rev1', 'ghost'))
726
726
 
 
727
    def test_get_known_graph_ancestry(self):
 
728
        tree = self.make_branch_and_tree('here')
 
729
        tree.lock_write()
 
730
        self.addCleanup(tree.unlock)
 
731
        # A
 
732
        # |\
 
733
        # | B
 
734
        # |/
 
735
        # C
 
736
        tree.commit('initial commit', rev_id='A')
 
737
        tree_other = tree.bzrdir.sprout('there').open_workingtree()
 
738
        tree_other.commit('another', rev_id='B')
 
739
        tree.merge_from_branch(tree_other.branch)
 
740
        tree.commit('another', rev_id='C')
 
741
        kg = tree.branch.repository.get_known_graph_ancestry(
 
742
            ['C'])
 
743
        self.assertEqual(['C'], list(kg.heads(['A', 'B', 'C'])))
 
744
        self.assertEqual(['A', 'B', 'C'], list(kg.topo_sort()))
 
745
 
727
746
    def test_parent_map_type(self):
728
747
        tree = self.make_branch_and_tree('here')
729
748
        tree.lock_write()