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

merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
 
 
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
23
import bzrlib
24
24
from bzrlib import bzrdir, errors, repository
25
25
from bzrlib.branch import Branch, needs_read_lock, needs_write_lock
26
 
from bzrlib.delta import TreeDelta, compare_trees
 
26
from bzrlib.delta import TreeDelta
27
27
from bzrlib.errors import (FileExists,
28
28
                           NoSuchRevision,
29
29
                           NoSuchFile,
30
30
                           UninitializableFormat,
31
31
                           NotBranchError,
32
32
                           )
 
33
from bzrlib.inventory import Inventory
33
34
from bzrlib.revision import NULL_REVISION
34
35
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
35
36
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
147
148
        tree = wt.branch.repository.revision_tree('revision-1')
148
149
        self.assertEqual(list(tree.list_files()), [])
149
150
        tree = wt.branch.repository.revision_tree(None)
150
 
        self.assertEqual(len(tree.list_files()), 0)
 
151
        self.assertEqual([], list(tree.list_files()))
151
152
        tree = wt.branch.repository.revision_tree(NULL_REVISION)
152
 
        self.assertEqual(len(tree.list_files()), 0)
 
153
        self.assertEqual([], list(tree.list_files()))
153
154
 
154
155
    def test_fetch(self):
155
156
        # smoke test fetch to ensure that the convenience function works.
312
313
            self.assertEqual(revision.revision_id, revision_id)
313
314
            self.assertEqual(revision, repo.get_revision(revision_id))
314
315
 
 
316
 
315
317
class TestCaseWithComplexRepository(TestCaseWithRepository):
316
318
 
317
319
    def setUp(self):
343
345
        trees2 = [repository.revision_tree(t) for t in revision_ids]
344
346
        assert len(trees1) == len(trees2)
345
347
        for tree1, tree2 in zip(trees1, trees2):
346
 
            delta = compare_trees(tree1, tree2)
347
 
            assert not delta.has_changed()
 
348
            assert not tree2.changes_from(tree1).has_changed()
348
349
 
349
350
    def test_get_deltas_for_revisions(self):
350
351
        repository = self.bzrdir.open_repository()
426
427
        # a inventory with no parents and the revision has parents..
427
428
        # i.e. a ghost.
428
429
        repo = self.make_repository('inventory_with_unnecessary_ghost')
429
 
        inv = bzrlib.tree.EmptyTree().inventory
 
430
        inv = Inventory()
430
431
        sha1 = repo.add_inventory('ghost', inv, [])
431
432
        rev = bzrlib.revision.Revision(timestamp=0,
432
433
                                       timezone=None,