~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

Move working tree initialisation out from  Branch.initialize, deprecated Branch.initialize to Branch.create.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
 
216
216
    def _backup_control_dir(self):
217
217
        note('making backup of tree history')
218
 
        source = self.transport.clone('.bzr')
219
 
        self.transport.mkdir('.bzr.backup')
220
 
        backup = self.transport.clone('.bzr.backup')
221
 
        files = []
222
 
        directories = ['.']
223
 
        while directories:
224
 
            dir = directories.pop()
225
 
            if dir != '.':
226
 
                backup.mkdir(dir)
227
 
            for path in source.list_dir(dir):
228
 
                path = dir + '/' + path
229
 
                stat = source.stat(path)
230
 
                if S_ISDIR(stat.st_mode):
231
 
                    directories.append(path)
232
 
                else:
233
 
                    files.append(path)
234
 
        source.copy_to(files, backup)
235
 
        note('%s has been backed up to %s', source.base, backup.base)
 
218
        self.transport.copy_tree('.bzr', '.bzr.backup')
 
219
        note('%s.bzr has been backed up to %s.bzr.backup',
 
220
             self.transport.base,
 
221
             self.transport.base)
236
222
        note('if conversion fails, you can move this directory back to .bzr')
237
223
        note('if it succeeds, you can remove this directory if you wish')
238
224