/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/commit.py

Add a new method ``Tree.revision_tree`` which allows access to cached
trees for arbitrary revisions. This allows the in development dirstate
tree format to provide access to the callers to cached copies of 
inventory data which are cheaper to access than inventories from the
repository. (Robert Collins, Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
468
468
        """
469
469
        specific = self.specific_files
470
470
        deleted_ids = []
 
471
        deleted_paths = set()
471
472
        for path, ie in self.work_inv.iter_entries():
 
473
            if is_inside_any(deleted_paths, path):
 
474
                # The tree will delete the required ids recursively.
 
475
                continue
472
476
            if specific and not is_inside_any(specific, path):
473
477
                continue
474
478
            if not self.work_tree.has_filename(path):
 
479
                deleted_paths.add(path)
475
480
                self.reporter.missing(path)
476
 
                deleted_ids.append((path, ie.file_id))
477
 
        if deleted_ids:
478
 
            deleted_ids.sort(reverse=True)
479
 
            for path, file_id in deleted_ids:
480
 
                del self.work_inv[file_id]
481
 
            self.work_tree._write_inventory(self.work_inv)
 
481
                deleted_ids.append(ie.file_id)
 
482
        self.work_tree.unversion(deleted_ids)
482
483
 
483
484
    def _populate_new_inv(self):
484
485
        """Build revision inventory.