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

  • Committer: John Arbash Meinel
  • Date: 2008-08-13 17:25:16 UTC
  • mfrom: (3606.2.3 1.6)
  • mto: (3606.2.4 1.6)
  • mto: This revision was merged to the branch mainline in revision 3625.
  • Revision ID: john@arbash-meinel.com-20080813172516-mlg6z6anklyrq21j
Merge in 1.6 tip

Show diffs side-by-side

added added

removed removed

Lines of Context:
1218
1218
                mover = _mover
1219
1219
            try:
1220
1220
                child_pb.update('Apply phase', 0, 2)
1221
 
                self._apply_removals(new_inventory_delta, mover)
 
1221
                kind_changes = self._apply_removals(new_inventory_delta, mover)
1222
1222
                child_pb.update('Apply phase', 1, 2)
1223
1223
                modified_paths = self._apply_insertions(new_inventory_delta,
1224
 
                                                        mover)
 
1224
                                                        mover, kind_changes)
1225
1225
            except:
1226
1226
                mover.rollback()
1227
1227
                raise
1245
1245
        """
1246
1246
        tree_paths = list(self._tree_path_ids.iteritems())
1247
1247
        tree_paths.sort(reverse=True)
 
1248
        kind_changes = set()
1248
1249
        child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
1249
1250
        try:
1250
1251
            for num, data in enumerate(tree_paths):
1252
1253
                child_pb.update('removing file', num, len(tree_paths))
1253
1254
                full_path = self._tree.abspath(path)
1254
1255
                if trans_id in self._removed_contents:
 
1256
                    try:
 
1257
                        if (self.tree_kind(trans_id)
 
1258
                                != self.final_kind(trans_id)):
 
1259
                            kind_changes.add(trans_id)
 
1260
                    except NoSuchFile:
 
1261
                        pass
1255
1262
                    mover.pre_delete(full_path, os.path.join(self._deletiondir,
1256
1263
                                     trans_id))
1257
1264
                elif trans_id in self._new_name or trans_id in \
1275
1282
                    inventory_delta.append((path, None, file_id, None))
1276
1283
        finally:
1277
1284
            child_pb.finished()
 
1285
        return kind_changes
1278
1286
 
1279
 
    def _apply_insertions(self, inventory_delta, mover):
 
1287
    def _apply_insertions(self, inventory_delta, mover, kind_changes):
1280
1288
        """Perform tree operations that insert directory/inventory names.
1281
1289
 
1282
1290
        That is, create any files that need to be created, and restore from
1285
1293
 
1286
1294
        If inventory_delta is None, no inventory delta is calculated, and
1287
1295
        no list of modified paths is returned.
 
1296
 
 
1297
        kind_changes is a set of trans ids where the entry has changed
 
1298
        kind, and so an inventory delta entry should be created for them.
1288
1299
        """
1289
1300
        new_paths = self.new_paths(filesystem_only=(inventory_delta is None))
1290
1301
        modified_paths = []
1321
1332
                    if file_id is not None and (trans_id in self._new_id or
1322
1333
                        trans_id in self._new_name or
1323
1334
                        trans_id in self._new_parent
1324
 
                        or trans_id in self._new_executability):
 
1335
                        or trans_id in self._new_executability
 
1336
                        or trans_id in kind_changes):
1325
1337
                        try:
1326
1338
                            kind = self.final_kind(trans_id)
1327
1339
                        except NoSuchFile: