922
922
This might be a synthetic object for e.g. RemoteBranch and SVN.
924
from .branch import BranchFormatMetadir
924
from .bzrbranch import BranchFormatMetadir
925
925
return BranchFormatMetadir.find_format(self, name=name)
927
927
def _get_mkdir_mode(self):
933
933
def get_branch_reference(self, name=None):
934
934
"""See BzrDir.get_branch_reference()."""
935
from .branch import BranchFormatMetadir
935
from .bzrbranch import BranchFormatMetadir
936
936
format = BranchFormatMetadir.find_format(self, name=name)
937
937
return format.get_reference(self, name=name)
939
939
def set_branch_reference(self, target_branch, name=None):
940
format = _mod_branch.BranchReferenceFormat()
940
format = _mod_bzrbranch.BranchReferenceFormat()
941
941
return format.initialize(self, target_branch=target_branch, name=name)
943
943
def get_branch_transport(self, branch_format, name=None):
1027
1027
Note: if you're going to open the working tree, you should just go
1028
1028
ahead and try, and not ask permission first.
1030
from .workingtree import WorkingTreeFormatMetaDir
1030
from .bzrworkingtree import WorkingTreeFormatMetaDir
1032
1032
WorkingTreeFormatMetaDir.find_format_string(self)
1033
1033
except errors.NoWorkingTree:
1077
1077
def open_repository(self, unsupported=False):
1078
1078
"""See BzrDir.open_repository."""
1079
from .repository import RepositoryFormatMetaDir
1079
from .bzrrepository import RepositoryFormatMetaDir
1080
1080
format = RepositoryFormatMetaDir.find_format(self)
1081
1081
format.check_support_status(unsupported)
1082
1082
return format.open(self, _found=True)
1084
1084
def open_workingtree(self, unsupported=False,
1085
1085
recommend_upgrade=True):
1086
1086
"""See BzrDir.open_workingtree."""
1087
from .workingtree import WorkingTreeFormatMetaDir
1087
from .bzrworkingtree import WorkingTreeFormatMetaDir
1088
1088
format = WorkingTreeFormatMetaDir.find_format(self)
1089
1089
format.check_support_status(unsupported, recommend_upgrade,
1090
1090
basedir=self.root_transport.base)
1643
1643
if target_branch is None:
1645
1645
# TODO: bad monkey, hard-coded formats...
1646
from .branch import BzrBranchFormat7
1646
from .bzrbranch import BzrBranchFormat7
1647
1647
new_branch_format = BzrBranchFormat7()
1649
1649
new_branch_format = target_branch._format
1809
1809
new = self.target_format.get_branch_format().__class__
1810
1810
while old != new:
1811
1811
if (old == fullhistorybranch.BzrBranchFormat5 and
1812
new in (_mod_branch.BzrBranchFormat6,
1813
_mod_branch.BzrBranchFormat7,
1814
_mod_branch.BzrBranchFormat8)):
1815
branch_converter = _mod_branch.Converter5to6()
1816
elif (old == _mod_branch.BzrBranchFormat6 and
1817
new in (_mod_branch.BzrBranchFormat7,
1818
_mod_branch.BzrBranchFormat8)):
1819
branch_converter = _mod_branch.Converter6to7()
1820
elif (old == _mod_branch.BzrBranchFormat7 and
1821
new is _mod_branch.BzrBranchFormat8):
1822
branch_converter = _mod_branch.Converter7to8()
1812
new in (_mod_bzrbranch.BzrBranchFormat6,
1813
_mod_bzrbranch.BzrBranchFormat7,
1814
_mod_bzrbranch.BzrBranchFormat8)):
1815
branch_converter = _mod_bzrbranch.Converter5to6()
1816
elif (old == _mod_bzrbranch.BzrBranchFormat6 and
1817
new in (_mod_bzrbranch.BzrBranchFormat7,
1818
_mod_bzrbranch.BzrBranchFormat8)):
1819
branch_converter = _mod_bzrbranch.Converter6to7()
1820
elif (old == _mod_bzrbranch.BzrBranchFormat7 and
1821
new is _mod_bzrbranch.BzrBranchFormat8):
1822
branch_converter = _mod_bzrbranch.Converter7to8()
1824
1824
raise errors.BadConversionTarget("No converter", new,
1825
1825
branch._format)
2127
2127
'breezy.repofmt.knitrepo.RepositoryFormatKnit1',
2128
2128
help='Variant of dirstate with support for tags. '
2129
2129
'Introduced in bzr 0.15.',
2130
branch_format='breezy.branch.BzrBranchFormat6',
2130
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2131
2131
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2133
2133
deprecated=True)
2135
2135
'breezy.repofmt.knitrepo.RepositoryFormatKnit4',
2136
2136
help='Variant of dirstate with better handling of tree roots. '
2137
2137
'Introduced in bzr 1.0',
2138
branch_format='breezy.branch.BzrBranchFormat6',
2138
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2139
2139
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2141
2141
deprecated=True)
2143
2143
'breezy.repofmt.knitrepo.RepositoryFormatKnit3',
2144
2144
help='Variant of dirstate with support for nested trees. '
2145
2145
'Introduced in 0.15.',
2146
branch_format='breezy.branch.BzrBranchFormat6',
2146
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2147
2147
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2148
2148
experimental=True,
2154
2154
'Interoperates with bzr repositories before 0.92 but cannot be '
2155
2155
'read by bzr < 0.92. '
2157
branch_format='breezy.branch.BzrBranchFormat6',
2157
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2158
2158
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2159
2159
deprecated=True,
2164
2164
'Introduced in 0.92. Interoperates with '
2165
2165
'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
2167
branch_format='breezy.branch.BzrBranchFormat6',
2167
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2168
2168
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2170
2170
deprecated=True,
2174
2174
'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack4',
2175
2175
help='A variant of pack-0.92 that supports rich-root data '
2176
2176
'(needed for bzr-svn and bzr-git). Introduced in 1.0.',
2177
branch_format='breezy.branch.BzrBranchFormat6',
2177
branch_format='breezy.bzrbranch.BzrBranchFormat6',
2178
2178
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2180
2180
deprecated=True,
2184
2184
help='A format that allows a branch to indicate that there is another '
2185
2185
'(stacked) repository that should be used to access data that is '
2186
2186
'not present locally.',
2187
branch_format='breezy.branch.BzrBranchFormat7',
2187
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2188
2188
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2190
2190
deprecated=True,
2193
2193
'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot',
2194
2194
help='A variant of 1.6 that supports rich-root data '
2195
2195
'(needed for bzr-svn and bzr-git).',
2196
branch_format='breezy.branch.BzrBranchFormat7',
2196
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2197
2197
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2199
2199
deprecated=True,
2203
2203
help='A repository format using B+tree indexes. These indexes '
2204
2204
'are smaller in size, have smarter caching and provide faster '
2205
2205
'performance for most operations.',
2206
branch_format='breezy.branch.BzrBranchFormat7',
2206
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2207
2207
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2209
2209
deprecated=True,
2212
2212
'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2213
2213
help='A variant of 1.9 that supports rich-root data '
2214
2214
'(needed for bzr-svn and bzr-git).',
2215
branch_format='breezy.branch.BzrBranchFormat7',
2215
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2216
2216
tree_format='breezy.workingtree_4.WorkingTreeFormat4',
2218
2218
deprecated=True,
2220
2220
register_metadir(controldir.format_registry, '1.14',
2221
2221
'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6',
2222
2222
help='A working-tree format that supports content filtering.',
2223
branch_format='breezy.branch.BzrBranchFormat7',
2223
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2224
2224
tree_format='breezy.workingtree_4.WorkingTreeFormat5',
2226
2226
deprecated=True,
2229
2229
'breezy.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot',
2230
2230
help='A variant of 1.14 that supports rich-root data '
2231
2231
'(needed for bzr-svn and bzr-git).',
2232
branch_format='breezy.branch.BzrBranchFormat7',
2232
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2233
2233
tree_format='breezy.workingtree_4.WorkingTreeFormat5',
2235
2235
deprecated=True,
2243
2243
'this format can only be read by bzr.dev. Please read '
2244
2244
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2246
branch_format='breezy.branch.BzrBranchFormat7',
2246
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2247
2247
tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2248
2248
experimental=True,
2259
2259
'this format can only be read by bzr.dev. Please read '
2260
2260
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
2262
branch_format='breezy.branch.BzrBranchFormat7',
2262
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2263
2263
tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2264
2264
experimental=True,
2269
2269
register_metadir(controldir.format_registry, 'development-colo',
2270
2270
'breezy.repofmt.groupcompress_repo.RepositoryFormat2a',
2271
2271
help='The 2a format with experimental support for colocated branches.\n',
2272
branch_format='breezy.branch.BzrBranchFormat7',
2272
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2273
2273
tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2274
2274
experimental=True,
2275
2275
bzrdir_format=BzrDirMetaFormat1Colo,
2286
2286
'Provides rich roots which are a one-way transition.\n',
2287
2287
# 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
2288
2288
# 'rich roots. Supported by bzr 1.16 and later.',
2289
branch_format='breezy.branch.BzrBranchFormat7',
2289
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2290
2290
tree_format='breezy.workingtree_4.WorkingTreeFormat6',
2291
2291
experimental=False,
2295
2295
# of the default format
2296
2296
register_metadir(controldir.format_registry, 'default-rich-root',
2297
2297
'breezy.repofmt.groupcompress_repo.RepositoryFormat2a',
2298
branch_format='breezy.branch.BzrBranchFormat7',
2298
branch_format='breezy.bzrbranch.BzrBranchFormat7',
2299
2299
tree_format='breezy.workingtree_4.WorkingTreeFormat6',