~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-18 23:21:01 UTC
  • mfrom: (5799 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110418232101-utgj6599ow9ny9nh
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    )
42
42
from bzrlib.bundle import serializer
43
43
from bzrlib.recordcounter import RecordCounter
44
 
from bzrlib.revisiontree import RevisionTree
 
44
from bzrlib.revisiontree import InventoryRevisionTree
45
45
from bzrlib.store.versioned import VersionedFileStore
46
46
from bzrlib.testament import Testament
47
47
""")
236
236
    def revision_tree(self):
237
237
        """Return the tree that was just committed.
238
238
 
239
 
        After calling commit() this can be called to get a RevisionTree
240
 
        representing the newly committed tree. This is preferred to
241
 
        calling Repository.revision_tree() because that may require
242
 
        deserializing the inventory, while we already have a copy in
 
239
        After calling commit() this can be called to get a
 
240
        InventoryRevisionTree representing the newly committed tree. This is
 
241
        preferred to calling Repository.revision_tree() because that may
 
242
        require deserializing the inventory, while we already have a copy in
243
243
        memory.
244
244
        """
245
245
        if self.new_inventory is None:
246
246
            self.new_inventory = self.repository.get_inventory(
247
247
                self._new_revision_id)
248
 
        return RevisionTree(self.repository, self.new_inventory,
 
248
        return InventoryRevisionTree(self.repository, self.new_inventory,
249
249
            self._new_revision_id)
250
250
 
251
251
    def finish_inventory(self):
2513
2513
        # TODO: refactor this to use an existing revision object
2514
2514
        # so we don't need to read it in twice.
2515
2515
        if revision_id == _mod_revision.NULL_REVISION:
2516
 
            return RevisionTree(self, Inventory(root_id=None),
2517
 
                                _mod_revision.NULL_REVISION)
 
2516
            return InventoryRevisionTree(self,
 
2517
                Inventory(root_id=None), _mod_revision.NULL_REVISION)
2518
2518
        else:
2519
2519
            inv = self.get_inventory(revision_id)
2520
 
            return RevisionTree(self, inv, revision_id)
 
2520
            return InventoryRevisionTree(self, inv, revision_id)
2521
2521
 
2522
2522
    def revision_trees(self, revision_ids):
2523
2523
        """Return Trees for revisions in this repository.
2527
2527
        """
2528
2528
        inventories = self.iter_inventories(revision_ids)
2529
2529
        for inv in inventories:
2530
 
            yield RevisionTree(self, inv, inv.revision_id)
 
2530
            yield InventoryRevisionTree(self, inv, inv.revision_id)
2531
2531
 
2532
2532
    def _filtered_revision_trees(self, revision_ids, file_ids):
2533
2533
        """Return Tree for a revision on this branch with only some files.
2543
2543
            # Should we introduce a FilteredRevisionTree class rather
2544
2544
            # than pre-filter the inventory here?
2545
2545
            filtered_inv = inv.filter(file_ids)
2546
 
            yield RevisionTree(self, filtered_inv, filtered_inv.revision_id)
 
2546
            yield InventoryRevisionTree(self, filtered_inv, filtered_inv.revision_id)
2547
2547
 
2548
2548
    @needs_read_lock
2549
2549
    def get_ancestry(self, revision_id, topo_sorted=True):