~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
281
281
        rev = tree.branch.repository.get_revision('3')
282
282
        history = rev.get_history(tree.branch.repository)
283
283
        self.assertEqual([None, '1', '2' ,'3'], history)
 
284
 
 
285
 
 
286
class TestMultipleRevisionSources(TestCaseWithTransport):
 
287
    """Tests for the MultipleRevisionSources adapter."""
 
288
 
 
289
    def test_get_revision_graph_merges_ghosts(self):
 
290
        # when we ask for the revision graph for B, which
 
291
        # is in repo 1 with a ghost of A, and which is not
 
292
        # in repo 2, which has A, the revision_graph()
 
293
        # should return A and B both.
 
294
        tree_1 = self.make_branch_and_tree('1')
 
295
        tree_1.add_pending_merge('A')
 
296
        tree_1.commit('foo', rev_id='B', allow_pointless=True)
 
297
        tree_2 = self.make_branch_and_tree('2')
 
298
        tree_2.commit('bar', rev_id='A', allow_pointless=True)
 
299
        source = MultipleRevisionSources(tree_1.branch.repository,
 
300
                                         tree_2.branch.repository)
 
301
        self.assertEqual({'B':['A'],
 
302
                          'A':[]},
 
303
                         source.get_revision_graph('B'))