~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-09-12 09:00:36 UTC
  • Revision ID: mbp@sourcefrog.net-20050912090036-ae51fea7f02bfcd0
- fix bugs in adding files in subdirectories

Show diffs side-by-side

added added

removed removed

Lines of Context:
264
264
 
265
265
    def _store_files(self):
266
266
        """Store new texts of modified/added files."""
267
 
        for path, id, kind in self.delta.modified:
268
 
            if kind != 'file':
269
 
                continue
270
 
            self._store_file_text(id)
271
 
 
272
 
        for path, id, kind in self.delta.added:
273
 
            if kind != 'file':
274
 
                continue
275
 
            self._store_file_text(id)
276
 
 
277
 
        for old_path, new_path, id, kind, text_modified in self.delta.renamed:
 
267
        # We must make sure that directories are added before anything
 
268
        # inside them is added.  the files within the delta report are
 
269
        # sorted by path so we know the directory will come before its
 
270
        # contents. 
 
271
        for path, file_id, kind in self.delta.added:
 
272
            if kind != 'file':
 
273
                ie = self.work_inv[file_id].copy()
 
274
                self.new_inv.add(ie)
 
275
            else:
 
276
                self._store_file_text(file_id)
 
277
 
 
278
        for path, file_id, kind in self.delta.modified:
 
279
            if kind != 'file':
 
280
                continue
 
281
            self._store_file_text(file_id)
 
282
 
 
283
        for old_path, new_path, file_id, kind, text_modified in self.delta.renamed:
278
284
            if kind != 'file':
279
285
                continue
280
286
            if not text_modified:
281
287
                continue
282
 
            self._store_file_text(id)
 
288
            self._store_file_text(file_id)
283
289
 
284
290
 
285
291
    def _store_file_text(self, file_id):