~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

[merge] bzr.dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
from bzrlib.symbol_versioning import (deprecated_method,
39
39
        zero_nine, 
40
40
        )
 
41
from bzrlib.testament import Testament
41
42
from bzrlib.trace import mutter, note
42
 
from bzrlib.tree import RevisionTree, EmptyTree
 
43
from bzrlib.tree import RevisionTree
43
44
from bzrlib.tsort import topo_sort
44
 
from bzrlib.testament import Testament
45
 
from bzrlib.tree import EmptyTree
46
45
from bzrlib.weave import WeaveFile
47
46
 
48
47
 
347
346
                     t in self.revision_trees(required_trees))
348
347
        for revision in revisions:
349
348
            if not revision.parent_ids:
350
 
                old_tree = EmptyTree()
 
349
                old_tree = self.revision_tree(None)
351
350
            else:
352
351
                old_tree = trees[revision.parent_ids[0]]
353
352
            yield delta.compare_trees(old_tree, trees[revision.revision_id])
565
564
    def revision_tree(self, revision_id):
566
565
        """Return Tree for a revision on this branch.
567
566
 
568
 
        `revision_id` may be None for the null revision, in which case
569
 
        an `EmptyTree` is returned."""
 
567
        `revision_id` may be None for the empty tree revision.
 
568
        """
570
569
        # TODO: refactor this to use an existing revision object
571
570
        # so we don't need to read it in twice.
572
571
        if revision_id is None or revision_id == NULL_REVISION:
573
 
            return EmptyTree()
 
572
            return RevisionTree(self, Inventory(), NULL_REVISION)
574
573
        else:
575
574
            inv = self.get_revision_inventory(revision_id)
576
575
            return RevisionTree(self, inv, revision_id)
746
745
            present_parents.append(p_id)
747
746
            parent_trees[p_id] = repository.revision_tree(p_id)
748
747
        else:
749
 
            parent_trees[p_id] = EmptyTree()
 
748
            parent_trees[p_id] = repository.revision_tree(None)
750
749
 
751
750
    inv = revision_tree.inventory
752
751