~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-09-15 06:20:01 UTC
  • Revision ID: mbp@sourcefrog.net-20050915062001-e127244e78bc21cf
- fix handling of selective commit with deleted files

- test for this

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
        Files that were added and deleted
269
269
        in the working copy don't matter.
270
270
        """
271
 
        any_deletes = False
272
 
        for file_id in list(iter(self.work_inv)): # snapshot for deletion
273
 
            if not self.work_tree.has_id(file_id):
274
 
                note('missing %s', self.work_inv.id2path(file_id))
 
271
        specific = self.specific_files
 
272
        deleted_ids = []
 
273
        for path, ie in self.work_inv.iter_entries():
 
274
            if specific and not is_inside_any(specific, path):
 
275
                continue
 
276
            if not self.work_tree.has_filename(path):
 
277
                note('missing %s', path)
 
278
                deleted_ids.append(ie.file_id)
 
279
        if deleted_ids:
 
280
            for file_id in deleted_ids:
275
281
                del self.work_inv[file_id]
276
 
                any_deletes = True
277
 
        if any_deletes:
278
282
            self.branch._write_inventory(self.work_inv)
279
283
 
280
284