~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/test_repository.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        wt.set_root_id('fixed-root')
148
148
        wt.commit('lala!', rev_id='revision-1', allow_pointless=True)
149
149
        tree = wt.branch.repository.revision_tree('revision-1')
150
 
        self.assertEqual(list(tree.list_files()), [('', 'V', 'directory', 
151
 
            'fixed-root', InventoryDirectory('fixed-root', '', None))])
 
150
        self.assertEqual('revision-1', tree.inventory.root.revision) 
 
151
        expected = InventoryDirectory('fixed-root', '', None)
 
152
        expected.revision = 'revision-1'
 
153
        self.assertEqual([('', 'V', 'directory', 'fixed-root', expected)],
 
154
                         list(tree.list_files()))
152
155
        tree = wt.branch.repository.revision_tree(None)
153
156
        self.assertEqual([], list(tree.list_files()))
154
157
        tree = wt.branch.repository.revision_tree(NULL_REVISION)
315
318
            self.assertEqual(revision.revision_id, revision_id)
316
319
            self.assertEqual(revision, repo.get_revision(revision_id))
317
320
 
 
321
    def test_root_entry_has_revision(self):
 
322
        tree = self.make_branch_and_tree('.')
 
323
        tree.commit('message', rev_id='rev_id')
 
324
        self.assertEqual('rev_id', tree.basis_tree().inventory.root.revision)
 
325
        rev_tree = tree.branch.repository.revision_tree(tree.last_revision())
 
326
        self.assertEqual('rev_id', rev_tree.inventory.root.revision)
 
327
 
318
328
 
319
329
class TestCaseWithComplexRepository(TestCaseWithRepository):
320
330