/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

  • Committer: Martin Pool
  • Date: 2007-10-15 04:26:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2913.
  • Revision ID: mbp@sourcefrog.net-20071015042629-83b1oaswtisv1adf
More efficient reporting of deletions from a large tree during commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
        # A merge with no effect on files
408
408
        if len(self.parents) > 1:
409
409
            return
410
 
        # work around the fact that a newly-initted tree does differ from its
411
 
        # basis
 
410
        # TODO: we could simplify this by using self.basis_delta.
 
411
 
 
412
        # The inital commit adds a root directory, but this in itself is not
 
413
        # a worthwhile commit.  
412
414
        if len(self.basis_inv) == 0 and len(self.builder.new_inventory) == 1:
413
415
            raise PointlessCommit()
414
416
        # Shortcut, if the number of entries changes, then we obviously have
684
686
            set(self.builder.new_inventory._byid.keys())
685
687
        if deleted_ids:
686
688
            self.any_entries_deleted = True
687
 
            # TODO: better to just look up the paths for particular things we
688
 
            # care about?  probably the common case is that most of the tree
689
 
            # is not deleted.
690
 
            for path, ie in self.basis_inv.iter_entries():
691
 
                if ie.file_id in deleted_ids:
692
 
                    self.basis_delta.append((path, None, ie.file_id, None))
693
 
                    self.reporter.deleted(path)
 
689
            deleted = [(self.basis_inv.id2path(file_id), file_id)
 
690
                for file_id in deleted_ids]
 
691
            deleted.sort()
 
692
            # XXX: this is not quite directory-order sorting
 
693
            for path, file_id in deleted:
 
694
                self.basis_delta.append((path, None, file_id, None))
 
695
                self.reporter.deleted(path)
694
696
 
695
697
    def _populate_from_inventory(self, specific_files):
696
698
        """Populate the CommitBuilder by walking the working tree inventory."""