~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2006-09-07 08:46:18 UTC
  • mto: (1991.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1992.
  • Revision ID: robertc@robertcollins.net-20060907084618-fae5efc1ca3c108d
When an entire subtree has been deleted, commit will now report that
just the top of the subtree has been deleted, rather than reporting
all the individual items. (Robert Collins)

Commit performs one less XML parse. (Robert Collins)

Show diffs side-by-side

added added

removed removed

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