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

Support backing up bare repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
470
470
        return branch
471
471
 
472
472
    def backup_bzrdir(self):
473
 
        if self._git.bare:
 
473
        if not self._git.bare:
474
474
            self.root_transport.copy_tree(".git", ".git.backup")
475
475
            return (self.root_transport.abspath(".git"),
476
476
                    self.root_transport.abspath(".git.backup"))
477
477
        else:
478
 
            raise bzr_errors.BzrError("Unable to backup bare repositories")
 
478
            basename = urlutils.basename(self.root_transport.base)
 
479
            parent = self.root_transport.clone('..')
 
480
            parent.copy_tree(basename, basename + ".backup")
479
481
 
480
482
    def create_workingtree(self, revision_id=None, from_branch=None,
481
483
        accelerator_tree=None, hardlink=False):