67
67
from bzrlib.repofmt import pack_repo
68
68
from bzrlib.smart.client import _SmartClient
69
from bzrlib.store.versioned import WeaveStore
69
from bzrlib.store.versioned import VersionedFileStore
70
70
from bzrlib.transactions import WriteTransaction
71
71
from bzrlib.transport import (
72
72
do_catching_redirections,
76
from bzrlib.weave import Weave
76
from bzrlib.weave import (
79
82
from bzrlib.trace import (
1027
1029
tree.clone(result)
1030
def create_branch(self, name=None):
1032
def create_branch(self, name=None, repository=None):
1031
1033
"""See BzrDir.create_branch."""
1034
if repository is not None:
1035
raise NotImplementedError(
1036
"create_branch(repository=<not None>) on %r" % (self,))
1032
1037
return self._format.get_branch_format().initialize(self, name=name)
1034
1039
def destroy_branch(self, name=None):
1264
1269
"""See BzrDir.can_convert_format()."""
1267
def create_branch(self, name=None):
1272
def create_branch(self, name=None, repository=None):
1268
1273
"""See BzrDir.create_branch."""
1269
return self._format.get_branch_format().initialize(self, name=name)
1274
return self._format.get_branch_format().initialize(self, name=name,
1275
repository=repository)
1271
1277
def destroy_branch(self, name=None):
1272
1278
"""See BzrDir.create_branch."""
1663
1669
utf8_files = [('README',
1664
1670
"This is a Bazaar control directory.\n"
1665
1671
"Do not change any files in this directory.\n"
1666
"See http://bazaar-vcs.org/ for more information about Bazaar.\n"),
1672
"See http://bazaar.canonical.com/ for more information about Bazaar.\n"),
1667
1673
('branch-format', self.get_format_string()),
1669
1675
# NB: no need to escape relative paths that are url safe.
2249
2255
mode=self.bzrdir._get_file_mode())
2251
2257
def _write_all_weaves(self):
2252
controlweaves = WeaveStore(self.bzrdir.transport, prefixed=False)
2258
controlweaves = VersionedFileStore(self.bzrdir.transport, prefixed=False,
2259
versionedfile_class=WeaveFile)
2253
2260
weave_transport = self.bzrdir.transport.clone('weaves')
2254
weaves = WeaveStore(weave_transport, prefixed=False)
2261
weaves = VersionedFileStore(weave_transport, prefixed=False,
2262
versionedfile_class=WeaveFile)
2255
2263
transaction = WriteTransaction()
3254
3262
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3256
3264
# The following un-numbered 'development' formats should always just be aliases.
3257
register_metadir(controldir.format_registry, 'development-rich-root',
3258
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK1',
3259
help='Current development format. Supports rich roots. Can convert data '
3260
'to and from rich-root-pack (and anything compatible with '
3261
'rich-root-pack) format repositories. Repositories and branches in '
3262
'this format can only be read by bzr.dev. Please read '
3263
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3265
branch_format='bzrlib.branch.BzrBranchFormat7',
3266
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3271
register_metadir(controldir.format_registry, 'development5-subtree',
3272
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3273
help='Development format, subtree variant. Can convert data to and '
3274
'from pack-0.92-subtree (and anything compatible with '
3275
'pack-0.92-subtree) format repositories. Repositories and branches in '
3276
'this format can only be read by bzr.dev. Please read '
3277
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3279
branch_format='bzrlib.branch.BzrBranchFormat7',
3280
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3287
3265
register_metadir(controldir.format_registry, 'development-subtree',
3288
3266
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2aSubtree',
3289
3267
help='Current development format, subtree variant. Can convert data to and '
3300
3278
# This current non-alias status is simply because we did not introduce a
3301
3279
# chk based subtree format.
3281
register_metadir(controldir.format_registry, 'development5-subtree',
3282
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3283
help='Development format, subtree variant. Can convert data to and '
3284
'from pack-0.92-subtree (and anything compatible with '
3285
'pack-0.92-subtree) format repositories. Repositories and branches in '
3286
'this format can only be read by bzr.dev. Please read '
3287
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3289
branch_format='bzrlib.branch.BzrBranchFormat7',
3290
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3304
3296
# And the development formats above will have aliased one of the following:
3305
register_metadir(controldir.format_registry, 'development6-rich-root',
3306
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK1',
3307
help='pack-1.9 with 255-way hashed CHK inv, group compress, rich roots '
3309
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3311
branch_format='bzrlib.branch.BzrBranchFormat7',
3312
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3317
register_metadir(controldir.format_registry, 'development7-rich-root',
3318
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK2',
3319
help='pack-1.9 with 255-way hashed CHK inv, bencode revision, group compress, '
3320
'rich roots. Please read '
3321
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3323
branch_format='bzrlib.branch.BzrBranchFormat7',
3324
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3298
# Finally, the current format.
3329
3299
register_metadir(controldir.format_registry, '2a',
3330
3300
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
3331
3301
help='First format for bzr 2.0 series.\n'