~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-10-31 21:29:02 UTC
  • mfrom: (2104 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2110.
  • Revision ID: john@arbash-meinel.com-20061031212902-4b33920b90e9ce92
[merge] bzr.dev 2104

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
                           UninitializableFormat,
31
31
                           NotBranchError,
32
32
                           )
33
 
from bzrlib.inventory import Inventory
 
33
from bzrlib.inventory import Inventory, InventoryDirectory
34
34
from bzrlib.revision import NULL_REVISION
35
35
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
36
36
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
153
153
 
154
154
    def test_revision_tree(self):
155
155
        wt = self.make_branch_and_tree('.')
 
156
        wt.set_root_id('fixed-root')
156
157
        wt.commit('lala!', rev_id='revision-1', allow_pointless=True)
157
158
        tree = wt.branch.repository.revision_tree('revision-1')
158
 
        self.assertEqual(list(tree.list_files()), [])
 
159
        self.assertEqual('revision-1', tree.inventory.root.revision) 
 
160
        expected = InventoryDirectory('fixed-root', '', None)
 
161
        expected.revision = 'revision-1'
 
162
        self.assertEqual([('', 'V', 'directory', 'fixed-root', expected)],
 
163
                         list(tree.list_files(include_root=True)))
159
164
        tree = wt.branch.repository.revision_tree(None)
160
 
        self.assertEqual([], list(tree.list_files()))
 
165
        self.assertEqual([], list(tree.list_files(include_root=True)))
161
166
        tree = wt.branch.repository.revision_tree(NULL_REVISION)
162
 
        self.assertEqual([], list(tree.list_files()))
 
167
        self.assertEqual([], list(tree.list_files(include_root=True)))
163
168
 
164
169
    def test_fetch(self):
165
170
        # smoke test fetch to ensure that the convenience function works.
582
587
        FOO_ID = 'foo<:>ID'
583
588
        REV_ID = 'revid-1'
584
589
        wt = self.make_branch_and_tree('repo')
585
 
        self.build_tree(["repo/foo"])
 
590
        self.build_tree(["repo/foo"], line_endings='binary')
586
591
        # add file with id containing wierd characters
587
592
        wt.add(['foo'], [FOO_ID])
588
593
        wt.commit('this is my new commit', rev_id=REV_ID)