~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

Merge orphan-non-versioned-files into deprecate-get-backup-name resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    multiparent,
36
36
    osutils,
37
37
    revision as _mod_revision,
 
38
    trace,
38
39
    ui,
39
40
    )
40
41
""")
1311
1312
    def new_orphan(self, trans_id, parent_id):
1312
1313
        """See TreeTransformBase.new_orphan."""
1313
1314
        # Add the orphan dir if it doesn't exist
1314
 
        od_id = self.trans_id_tree_path('bzr-orphans')
 
1315
        orphan_dir = 'bzr-orphans'
 
1316
        od_id = self.trans_id_tree_path(orphan_dir)
1315
1317
        if self.final_kind(od_id) is None:
1316
1318
            self.create_directory(od_id)
 
1319
        parent_path = self._tree_id_paths[parent_id]
1317
1320
        # Find a name that doesn't exist yet in the orphan dir
1318
 
        new_name = self._available_backup_name(self.final_name(trans_id), od_id)
 
1321
        actual_name = self.final_name(trans_id)
 
1322
        new_name = self._available_backup_name(actual_name, od_id)
1319
1323
        self.adjust_path(new_name, od_id, trans_id)
 
1324
        trace.warning('%s has been orphaned in %s'
 
1325
                      % (joinpath(parent_path, actual_name), orphan_dir))
1320
1326
 
1321
1327
 
1322
1328
class TreeTransform(DiskTreeTransform):