517
517
raise NotImplementedError(self.create_workingtree)
519
def backup_bzrdir(self):
520
"""Backup this bzr control directory.
522
:return: Tuple with old path name and new path name
524
self.root_transport.copy_tree('.bzr', 'backup.bzr')
525
return (self.root_transport.abspath('.bzr'),
526
self.root_transport.abspath('backup.bzr'))
519
528
def retire_bzrdir(self, limit=10000):
520
529
"""Permanently disable the bzrdir.
1062
1071
def sprout(self, url, revision_id=None, force_new_repo=False,
1063
1072
recurse='down', possible_transports=None,
1064
accelerator_tree=None, hardlink=False, stacked=False):
1073
accelerator_tree=None, hardlink=False, stacked=False,
1074
source_branch=None):
1065
1075
"""Create a copy of this bzrdir prepared for use as a new line of
1088
1098
cloning_format = self.cloning_metadir(stacked)
1089
1099
# Create/update the result branch
1090
1100
result = cloning_format.initialize_on_transport(target_transport)
1092
source_branch = self.open_branch()
1093
source_repository = source_branch.repository
1101
# if a stacked branch wasn't requested, we don't create one
1102
# even if the origin was stacked
1103
stacked_branch_url = None
1104
if source_branch is not None:
1095
1106
stacked_branch_url = self.root_transport.base
1097
# if a stacked branch wasn't requested, we don't create one
1098
# even if the origin was stacked
1099
stacked_branch_url = None
1100
except errors.NotBranchError:
1101
source_branch = None
1107
source_repository = source_branch.repository
1103
source_repository = self.open_repository()
1104
except errors.NoRepositoryPresent:
1105
source_repository = None
1106
stacked_branch_url = None
1110
source_branch = self.open_branch()
1111
source_repository = source_branch.repository
1113
stacked_branch_url = self.root_transport.base
1114
except errors.NotBranchError:
1115
source_branch = None
1117
source_repository = self.open_repository()
1118
except errors.NoRepositoryPresent:
1119
source_repository = None
1107
1120
repository_policy = result.determine_repository_policy(
1108
1121
force_new_repo, stacked_branch_url, require_stacking=stacked)
1109
1122
result_repo = repository_policy.acquire_repository()
2647
2660
return self.get_format_description() == other.get_format_description()
2663
def repository_format(self):
2664
# Using a property to avoid early loading of remote
2665
return remote.RemoteRepositoryFormat()
2650
2668
BzrDirFormat.register_control_server_format(RemoteBzrDirFormat)