~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

Provide a revision.get_history(repository) method for generating a synthetic revision history.

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
        self.assertEquals(combined_1[2], combined_2[2])
302
302
        self.assertEquals(combined_1[3], combined_2[3])
303
303
        self.assertEquals(combined_1, combined_2)
 
304
 
 
305
    def test_get_history(self):
 
306
        # TODO: test ghosts on the left hand branch's impact
 
307
        # TODO: test ghosts on all parents, we should get some
 
308
        # indicator. i.e. NULL_REVISION
 
309
        # RBC 20060608
 
310
        tree = self.make_branch_and_tree('.')
 
311
        tree.commit('1', rev_id = '1', allow_pointless=True)
 
312
        tree.commit('2', rev_id = '2', allow_pointless=True)
 
313
        tree.commit('3', rev_id = '3', allow_pointless=True)
 
314
        rev = tree.branch.repository.get_revision('1')
 
315
        history = rev.get_history(tree.branch.repository)
 
316
        self.assertEqual([None, '1'], history)
 
317
        rev = tree.branch.repository.get_revision('2')
 
318
        history = rev.get_history(tree.branch.repository)
 
319
        self.assertEqual([None, '1', '2'], history)
 
320
        rev = tree.branch.repository.get_revision('3')
 
321
        history = rev.get_history(tree.branch.repository)
 
322
        self.assertEqual([None, '1', '2' ,'3'], history)