215
234
errors.UnstackableRepositoryFormat,
216
235
errors.NotStacked):
237
# Bug: We create a metadir without knowing if it can support stacking,
238
# we should look up the policy needs first, or just use it as a hint,
220
# may need to copy content in
221
repository_policy = result.determine_repository_policy(
222
force_new_repo, stacked_on, self.root_transport.base,
223
require_stacking=require_stacking)
224
241
make_working_trees = local_repo.make_working_trees()
225
result_repo, is_new_repo = repository_policy.acquire_repository(
226
make_working_trees, local_repo.is_shared())
227
if not require_stacking and repository_policy._require_stacking:
228
require_stacking = True
229
result._format.require_stacking()
230
if is_new_repo and not require_stacking and revision_id is not None:
231
fetch_spec = graph.PendingAncestryResult(
232
[revision_id], local_repo)
233
result_repo.fetch(local_repo, fetch_spec=fetch_spec)
235
result_repo.fetch(local_repo, revision_id=revision_id)
242
want_shared = local_repo.is_shared()
243
repo_format_name = format.repository_format.network_name()
245
make_working_trees = False
247
repo_format_name = None
249
result_repo, result, require_stacking, repository_policy = \
250
format.initialize_on_transport_ex(transport,
251
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
252
force_new_repo=force_new_repo, stacked_on=stacked_on,
253
stack_on_pwd=self.root_transport.base,
254
repo_format_name=repo_format_name,
255
make_working_trees=make_working_trees, shared_repo=want_shared)
258
# If the result repository is in the same place as the
259
# resulting bzr dir, it will have no content, further if the
260
# result is not stacked then we know all content should be
261
# copied, and finally if we are copying up to a specific
262
# revision_id then we can use the pending-ancestry-result which
263
# does not require traversing all of history to describe it.
264
if (result_repo.bzrdir.root_transport.base ==
265
result.root_transport.base and not require_stacking and
266
revision_id is not None):
267
fetch_spec = graph.PendingAncestryResult(
268
[revision_id], local_repo)
269
result_repo.fetch(local_repo, fetch_spec=fetch_spec)
271
result_repo.fetch(local_repo, revision_id=revision_id)
275
if result_repo is not None:
276
raise AssertionError('result_repo not None(%r)' % result_repo)
238
277
# 1 if there is a branch present
239
278
# make sure its content is available in the target repository
1257
def push_branch(self, source, revision_id=None, overwrite=False,
1258
remember=False, create_prefix=False):
1259
"""Push the source branch into this BzrDir."""
1261
# If we can open a branch, use its direct repository, otherwise see
1262
# if there is a repository without a branch.
1264
br_to = self.open_branch()
1265
except errors.NotBranchError:
1266
# Didn't find a branch, can we find a repository?
1267
repository_to = self.find_repository()
1269
# Found a branch, so we must have found a repository
1270
repository_to = br_to.repository
1272
push_result = PushResult()
1273
push_result.source_branch = source
1275
# We have a repository but no branch, copy the revisions, and then
1277
repository_to.fetch(source.repository, revision_id=revision_id)
1278
br_to = source.clone(self, revision_id=revision_id)
1279
if source.get_push_location() is None or remember:
1280
source.set_push_location(br_to.base)
1281
push_result.stacked_on = None
1282
push_result.branch_push_result = None
1283
push_result.old_revno = None
1284
push_result.old_revid = _mod_revision.NULL_REVISION
1285
push_result.target_branch = br_to
1286
push_result.master_branch = None
1287
push_result.workingtree_updated = False
1289
# We have successfully opened the branch, remember if necessary:
1290
if source.get_push_location() is None or remember:
1291
source.set_push_location(br_to.base)
1293
tree_to = self.open_workingtree()
1294
except errors.NotLocalUrl:
1295
push_result.branch_push_result = source.push(br_to,
1296
overwrite, stop_revision=revision_id)
1297
push_result.workingtree_updated = False
1298
except errors.NoWorkingTree:
1299
push_result.branch_push_result = source.push(br_to,
1300
overwrite, stop_revision=revision_id)
1301
push_result.workingtree_updated = None # Not applicable
1303
tree_to.lock_write()
1305
push_result.branch_push_result = source.push(
1306
tree_to.branch, overwrite, stop_revision=revision_id)
1310
push_result.workingtree_updated = True
1311
push_result.old_revno = push_result.branch_push_result.old_revno
1312
push_result.old_revid = push_result.branch_push_result.old_revid
1313
push_result.target_branch = \
1314
push_result.branch_push_result.target_branch
1200
1318
class BzrDirHooks(hooks.Hooks):
1201
1319
"""Hooks for BzrDir operations."""
1758
1909
self._supply_sub_formats_to(remote_format)
1759
1910
return remote_format.initialize_on_transport(transport)
1912
def initialize_on_transport_ex(self, transport, use_existing_dir=False,
1913
create_prefix=False, force_new_repo=False, stacked_on=None,
1914
stack_on_pwd=None, repo_format_name=None, make_working_trees=None,
1915
shared_repo=False, vfs_only=False):
1916
"""Create this format on transport.
1918
The directory to initialize will be created.
1920
:param force_new_repo: Do not use a shared repository for the target,
1921
even if one is available.
1922
:param create_prefix: Create any missing directories leading up to
1924
:param use_existing_dir: Use an existing directory if one exists.
1925
:param stacked_on: A url to stack any created branch on, None to follow
1926
any target stacking policy.
1927
:param stack_on_pwd: If stack_on is relative, the location it is
1929
:param repo_format_name: If non-None, a repository will be
1930
made-or-found. Should none be found, or if force_new_repo is True
1931
the repo_format_name is used to select the format of repository to
1933
:param make_working_trees: Control the setting of make_working_trees
1934
for a new shared repository when one is made. None to use whatever
1935
default the format has.
1936
:param shared_repo: Control whether made repositories are shared or
1938
:param vfs_only: If True do not attempt to use a smart server
1939
:return: repo, bzrdir, require_stacking, repository_policy. repo is
1940
None if none was created or found, bzrdir is always valid.
1941
require_stacking is the result of examining the stacked_on
1942
parameter and any stacking policy found for the target.
1945
# Try to hand off to a smart server
1947
client_medium = transport.get_smart_medium()
1948
except errors.NoSmartMedium:
1951
# TODO: lookup the local format from a server hint.
1952
remote_dir_format = RemoteBzrDirFormat()
1953
remote_dir_format._network_name = self.network_name()
1954
self._supply_sub_formats_to(remote_dir_format)
1955
return remote_dir_format.initialize_on_transport_ex(transport,
1956
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
1957
force_new_repo=force_new_repo, stacked_on=stacked_on,
1958
stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
1959
make_working_trees=make_working_trees, shared_repo=shared_repo)
1960
# XXX: Refactor the create_prefix/no_create_prefix code into a
1961
# common helper function
1962
# The destination may not exist - if so make it according to policy.
1963
def make_directory(transport):
1964
transport.mkdir('.')
1966
def redirected(transport, e, redirection_notice):
1967
note(redirection_notice)
1968
return transport._redirected_to(e.source, e.target)
1970
transport = do_catching_redirections(make_directory, transport,
1972
except errors.FileExists:
1973
if not use_existing_dir:
1975
except errors.NoSuchFile:
1976
if not create_prefix:
1978
transport.create_prefix()
1980
require_stacking = (stacked_on is not None)
1981
# Now the target directory exists, but doesn't have a .bzr
1982
# directory. So we need to create it, along with any work to create
1983
# all of the dependent branches, etc.
1985
result = self.initialize_on_transport(transport)
1986
if repo_format_name:
1988
# use a custom format
1989
result._format.repository_format = \
1990
repository.network_format_registry.get(repo_format_name)
1991
except AttributeError:
1992
# The format didn't permit it to be set.
1994
# A repository is desired, either in-place or shared.
1995
repository_policy = result.determine_repository_policy(
1996
force_new_repo, stacked_on, stack_on_pwd,
1997
require_stacking=require_stacking)
1998
result_repo, is_new_repo = repository_policy.acquire_repository(
1999
make_working_trees, shared_repo)
2000
if not require_stacking and repository_policy._require_stacking:
2001
require_stacking = True
2002
result._format.require_stacking()
2003
result_repo.lock_write()
2006
repository_policy = None
2007
return result_repo, result, require_stacking, repository_policy
1761
2009
def _initialize_on_transport_vfs(self, transport):
1762
2010
"""Initialize a new bzrdir using VFS calls.
1975
2223
repository_format = property(__return_repository_format)
1978
class BzrDirFormat5(BzrDirFormat):
2226
class BzrDirFormatAllInOne(BzrDirFormat):
2227
"""Common class for formats before meta-dirs."""
2229
def initialize_on_transport_ex(self, transport, use_existing_dir=False,
2230
create_prefix=False, force_new_repo=False, stacked_on=None,
2231
stack_on_pwd=None, repo_format_name=None, make_working_trees=None,
2233
"""See BzrDirFormat.initialize_on_transport_ex."""
2234
require_stacking = (stacked_on is not None)
2235
# Format 5 cannot stack, but we've been asked to - actually init
2237
if require_stacking:
2238
format = BzrDirMetaFormat1()
2239
return format.initialize_on_transport_ex(transport,
2240
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
2241
force_new_repo=force_new_repo, stacked_on=stacked_on,
2242
stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
2243
make_working_trees=make_working_trees, shared_repo=shared_repo)
2244
return BzrDirFormat.initialize_on_transport_ex(self, transport,
2245
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
2246
force_new_repo=force_new_repo, stacked_on=stacked_on,
2247
stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
2248
make_working_trees=make_working_trees, shared_repo=shared_repo)
2251
class BzrDirFormat5(BzrDirFormatAllInOne):
1979
2252
"""Bzr control format 5.
1981
2254
This format is a combined format for working tree, branch and repository.
2135
2408
def set_branch_format(self, format):
2136
2409
self._branch_format = format
2138
def require_stacking(self):
2411
def require_stacking(self, stack_on=None, possible_transports=None,
2413
"""We have a request to stack, try to ensure the formats support it.
2415
:param stack_on: If supplied, it is the URL to a branch that we want to
2416
stack on. Check to see if that format supports stacking before
2419
# Stacking is desired. requested by the target, but does the place it
2420
# points at support stacking? If it doesn't then we should
2421
# not implicitly upgrade. We check this here.
2422
new_repo_format = None
2423
new_branch_format = None
2425
# a bit of state for get_target_branch so that we don't try to open it
2426
# 2 times, for both repo *and* branch
2427
target = [None, False, None] # target_branch, checked, upgrade anyway
2428
def get_target_branch():
2430
# We've checked, don't check again
2432
if stack_on is None:
2433
# No target format, that means we want to force upgrading
2434
target[:] = [None, True, True]
2437
target_dir = BzrDir.open(stack_on,
2438
possible_transports=possible_transports)
2439
except errors.NotBranchError:
2440
# Nothing there, don't change formats
2441
target[:] = [None, True, False]
2443
except errors.JailBreak:
2444
# JailBreak, JFDI and upgrade anyway
2445
target[:] = [None, True, True]
2448
target_branch = target_dir.open_branch()
2449
except errors.NotBranchError:
2450
# No branch, don't upgrade formats
2451
target[:] = [None, True, False]
2453
target[:] = [target_branch, True, False]
2456
if (not _skip_repo and
2457
not self.repository_format.supports_external_lookups):
2458
# We need to upgrade the Repository.
2459
target_branch, _, do_upgrade = get_target_branch()
2460
if target_branch is None:
2461
# We don't have a target branch, should we upgrade anyway?
2463
# stack_on is inaccessible, JFDI.
2464
# TODO: bad monkey, hard-coded formats...
2465
if self.repository_format.rich_root_data:
2466
new_repo_format = pack_repo.RepositoryFormatKnitPack5RichRoot()
2468
new_repo_format = pack_repo.RepositoryFormatKnitPack5()
2470
# If the target already supports stacking, then we know the
2471
# project is already able to use stacking, so auto-upgrade
2473
new_repo_format = target_branch.repository._format
2474
if not new_repo_format.supports_external_lookups:
2475
# target doesn't, source doesn't, so don't auto upgrade
2477
new_repo_format = None
2478
if new_repo_format is not None:
2479
self.repository_format = new_repo_format
2480
note('Source repository format does not support stacking,'
2481
' using format:\n %s',
2482
new_repo_format.get_format_description())
2139
2484
if not self.get_branch_format().supports_stacking():
2140
# We need to make a stacked branch, but the default format for the
2141
# target doesn't support stacking. So force a branch that *can*
2143
from bzrlib.branch import BzrBranchFormat7
2144
branch_format = BzrBranchFormat7()
2145
self.set_branch_format(branch_format)
2146
mutter("using %r for stacking" % (branch_format,))
2147
from bzrlib.repofmt import pack_repo
2148
if self.repository_format.rich_root_data:
2149
bzrdir_format_name = '1.6.1-rich-root'
2150
repo_format = pack_repo.RepositoryFormatKnitPack5RichRoot()
2485
# We just checked the repo, now lets check if we need to
2486
# upgrade the branch format
2487
target_branch, _, do_upgrade = get_target_branch()
2488
if target_branch is None:
2490
# TODO: bad monkey, hard-coded formats...
2491
new_branch_format = branch.BzrBranchFormat7()
2152
bzrdir_format_name = '1.6'
2153
repo_format = pack_repo.RepositoryFormatKnitPack5()
2154
note('Source format does not support stacking, using format:'
2156
bzrdir_format_name, repo_format.get_format_description())
2157
self.repository_format = repo_format
2493
new_branch_format = target_branch._format
2494
if not new_branch_format.supports_stacking():
2495
new_branch_format = None
2496
if new_branch_format is not None:
2497
# Does support stacking, use its format.
2498
self.set_branch_format(new_branch_format)
2499
note('Source branch format does not support stacking,'
2500
' using format:\n %s',
2501
new_branch_format.get_format_description())
2159
2503
def get_converter(self, format=None):
2160
2504
"""See BzrDirFormat.get_converter()."""
2811
3188
return local_dir_format.initialize_on_transport(transport)
2812
3189
client = _SmartClient(client_medium)
2813
3190
path = client.remote_path_from_transport(transport)
2814
response = client.call('BzrDirFormat.initialize', path)
3192
response = client.call('BzrDirFormat.initialize', path)
3193
except errors.ErrorFromSmartServer, err:
3194
remote._translate_error(err, path=path)
2815
3195
if response[0] != 'ok':
2816
3196
raise errors.SmartProtocolError('unexpected response code %s' % (response,))
2817
3197
format = RemoteBzrDirFormat()
2818
3198
self._supply_sub_formats_to(format)
2819
3199
return remote.RemoteBzrDir(transport, format)
3201
def parse_NoneTrueFalse(self, arg):
3208
raise AssertionError("invalid arg %r" % arg)
3210
def _serialize_NoneTrueFalse(self, arg):
3217
def _serialize_NoneString(self, arg):
3220
def initialize_on_transport_ex(self, transport, use_existing_dir=False,
3221
create_prefix=False, force_new_repo=False, stacked_on=None,
3222
stack_on_pwd=None, repo_format_name=None, make_working_trees=None,
3225
# hand off the request to the smart server
3226
client_medium = transport.get_smart_medium()
3227
except errors.NoSmartMedium:
3230
# Decline to open it if the server doesn't support our required
3231
# version (3) so that the VFS-based transport will do it.
3232
if client_medium.should_probe():
3234
server_version = client_medium.protocol_version()
3235
if server_version != '2':
3239
except errors.SmartProtocolError:
3240
# Apparently there's no usable smart server there, even though
3241
# the medium supports the smart protocol.
3246
client = _SmartClient(client_medium)
3247
path = client.remote_path_from_transport(transport)
3248
if client_medium._is_remote_before((1, 16)):
3251
# TODO: lookup the local format from a server hint.
3252
local_dir_format = BzrDirMetaFormat1()
3253
self._supply_sub_formats_to(local_dir_format)
3254
return local_dir_format.initialize_on_transport_ex(transport,
3255
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
3256
force_new_repo=force_new_repo, stacked_on=stacked_on,
3257
stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
3258
make_working_trees=make_working_trees, shared_repo=shared_repo,
3260
return self._initialize_on_transport_ex_rpc(client, path, transport,
3261
use_existing_dir, create_prefix, force_new_repo, stacked_on,
3262
stack_on_pwd, repo_format_name, make_working_trees, shared_repo)
3264
def _initialize_on_transport_ex_rpc(self, client, path, transport,
3265
use_existing_dir, create_prefix, force_new_repo, stacked_on,
3266
stack_on_pwd, repo_format_name, make_working_trees, shared_repo):
3268
args.append(self._serialize_NoneTrueFalse(use_existing_dir))
3269
args.append(self._serialize_NoneTrueFalse(create_prefix))
3270
args.append(self._serialize_NoneTrueFalse(force_new_repo))
3271
args.append(self._serialize_NoneString(stacked_on))
3272
# stack_on_pwd is often/usually our transport
3275
stack_on_pwd = transport.relpath(stack_on_pwd)
3276
if not stack_on_pwd:
3278
except errors.PathNotChild:
3280
args.append(self._serialize_NoneString(stack_on_pwd))
3281
args.append(self._serialize_NoneString(repo_format_name))
3282
args.append(self._serialize_NoneTrueFalse(make_working_trees))
3283
args.append(self._serialize_NoneTrueFalse(shared_repo))
3284
request_network_name = self._network_name or \
3285
BzrDirFormat.get_default_format().network_name()
3287
response = client.call('BzrDirFormat.initialize_ex_1.16',
3288
request_network_name, path, *args)
3289
except errors.UnknownSmartMethod:
3290
client._medium._remember_remote_is_before((1,16))
3291
local_dir_format = BzrDirMetaFormat1()
3292
self._supply_sub_formats_to(local_dir_format)
3293
return local_dir_format.initialize_on_transport_ex(transport,
3294
use_existing_dir=use_existing_dir, create_prefix=create_prefix,
3295
force_new_repo=force_new_repo, stacked_on=stacked_on,
3296
stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
3297
make_working_trees=make_working_trees, shared_repo=shared_repo,
3299
except errors.ErrorFromSmartServer, err:
3300
remote._translate_error(err, path=path)
3301
repo_path = response[0]
3302
bzrdir_name = response[6]
3303
require_stacking = response[7]
3304
require_stacking = self.parse_NoneTrueFalse(require_stacking)
3305
format = RemoteBzrDirFormat()
3306
format._network_name = bzrdir_name
3307
self._supply_sub_formats_to(format)
3308
bzrdir = remote.RemoteBzrDir(transport, format, _client=client)
3310
repo_format = remote.response_tuple_to_repo_format(response[1:])
3311
if repo_path == '.':
3314
repo_bzrdir_format = RemoteBzrDirFormat()
3315
repo_bzrdir_format._network_name = response[5]
3316
repo_bzr = remote.RemoteBzrDir(transport.clone(repo_path),
3320
final_stack = response[8] or None
3321
final_stack_pwd = response[9] or None
3323
final_stack_pwd = urlutils.join(
3324
transport.base, final_stack_pwd)
3325
remote_repo = remote.RemoteRepository(repo_bzr, repo_format)
3326
if len(response) > 10:
3327
# Updated server verb that locks remotely.
3328
repo_lock_token = response[10] or None
3329
remote_repo.lock_write(repo_lock_token, _skip_rpc=True)
3331
remote_repo.dont_leave_lock_in_place()
3333
remote_repo.lock_write()
3334
policy = UseExistingRepository(remote_repo, final_stack,
3335
final_stack_pwd, require_stacking)
3336
policy.acquire_repository()
3340
bzrdir._format.set_branch_format(self.get_branch_format())
3341
if require_stacking:
3342
# The repo has already been created, but we need to make sure that
3343
# we'll make a stackable branch.
3344
bzrdir._format.require_stacking(_skip_repo=True)
3345
return remote_repo, bzrdir, require_stacking, policy
2821
3347
def _open(self, transport):
2822
3348
return remote.RemoteBzrDir(transport, self)
3149
3685
stack_on = self._get_full_stack_on()
3151
# Stacking is desired. requested by the target, but does the place it
3152
# points at support stacking? If it doesn't then we should
3153
# not implicitly upgrade. We check this here.
3154
3687
format = self._bzrdir._format
3155
if not (format.repository_format.supports_external_lookups
3156
and format.get_branch_format().supports_stacking()):
3157
# May need to upgrade - but only do if the target also
3158
# supports stacking. Note that this currently wastes
3159
# network round trips to check - but we only do this
3160
# when the source can't stack so it will fade away
3161
# as people do upgrade.
3163
target_dir = BzrDir.open(stack_on,
3164
possible_transports=[self._bzrdir.root_transport])
3165
except errors.NotBranchError:
3166
# Nothing there, don't change formats
3170
target_branch = target_dir.open_branch()
3171
except errors.NotBranchError:
3172
# No branch, don't change formats
3175
branch_format = target_branch._format
3176
repo_format = target_branch.repository._format
3177
if not (branch_format.supports_stacking()
3178
and repo_format.supports_external_lookups):
3179
# Doesn't stack itself, don't force an upgrade
3182
# Does support stacking, use its format.
3183
format.repository_format = repo_format
3184
format.set_branch_format(branch_format)
3185
note('Source format does not support stacking, '
3186
'using format: \'%s\'\n %s\n',
3187
branch_format.get_format_description(),
3188
repo_format.get_format_description())
3688
format.require_stacking(stack_on=stack_on,
3689
possible_transports=[self._bzrdir.root_transport])
3189
3690
if not self._require_stacking:
3190
3691
# We have picked up automatic stacking somewhere.
3191
3692
note('Using default stacking branch %s at %s', self._stack_on,
3341
3848
'(needed for bzr-svn and bzr-git).',
3342
3849
branch_format='bzrlib.branch.BzrBranchFormat7',
3343
3850
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3345
format_registry.register_metadir('development-wt5',
3853
format_registry.register_metadir('1.14',
3346
3854
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
3347
help='A working-tree format that supports views and content filtering.',
3855
help='A working-tree format that supports content filtering.',
3348
3856
branch_format='bzrlib.branch.BzrBranchFormat7',
3349
3857
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3352
format_registry.register_metadir('development-wt5-rich-root',
3859
format_registry.register_metadir('1.14-rich-root',
3353
3860
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
3354
help='A variant of development-wt5 that supports rich-root data '
3861
help='A variant of 1.14 that supports rich-root data '
3355
3862
'(needed for bzr-svn and bzr-git).',
3356
3863
branch_format='bzrlib.branch.BzrBranchFormat7',
3357
3864
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3360
# The following two formats should always just be aliases.
3361
format_registry.register_metadir('development',
3362
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2',
3363
help='Current development format. Can convert data to and from pack-0.92 '
3364
'(and anything compatible with pack-0.92) format repositories. '
3365
'Repositories and branches in this format can only be read by bzr.dev. '
3367
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3866
# The following un-numbered 'development' formats should always just be aliases.
3867
format_registry.register_metadir('development-rich-root',
3868
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK1',
3869
help='Current development format. Supports rich roots. Can convert data '
3870
'to and from rich-root-pack (and anything compatible with '
3871
'rich-root-pack) format repositories. Repositories and branches in '
3872
'this format can only be read by bzr.dev. Please read '
3873
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3369
3875
branch_format='bzrlib.branch.BzrBranchFormat7',
3370
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3876
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3371
3877
experimental=True,
3374
3881
format_registry.register_metadir('development-subtree',
3375
3882
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3377
3884
'from pack-0.92-subtree (and anything compatible with '
3378
3885
'pack-0.92-subtree) format repositories. Repositories and branches in '
3379
3886
'this format can only be read by bzr.dev. Please read '
3380
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3887
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3382
3889
branch_format='bzrlib.branch.BzrBranchFormat7',
3383
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3890
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3384
3891
experimental=True,
3893
alias=False, # Restore to being an alias when an actual development subtree format is added
3894
# This current non-alias status is simply because we did not introduce a
3895
# chk based subtree format.
3387
3898
# And the development formats above will have aliased one of the following:
3388
format_registry.register_metadir('development2',
3389
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2',
3390
help='1.6.1 with B+Tree based index. '
3392
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3394
branch_format='bzrlib.branch.BzrBranchFormat7',
3395
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3399
format_registry.register_metadir('development2-subtree',
3400
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3401
help='1.6.1-subtree with B+Tree based index. '
3403
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3405
branch_format='bzrlib.branch.BzrBranchFormat7',
3406
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3410
format_registry.register_metadir('development5',
3411
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment5',
3412
help='1.9 with CHK inventories with parent_id index. '
3414
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3416
branch_format='bzrlib.branch.BzrBranchFormat7',
3417
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3421
format_registry.register_metadir('development5-subtree',
3422
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment5Subtree',
3423
help='1.9-subtree with CHK Inventories with parent_id index. '
3425
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3427
branch_format='bzrlib.branch.BzrBranchFormat7',
3428
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3432
format_registry.register_metadir('development5-hash16',
3433
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment5Hash16',
3434
help='1.9 with CHK inventories with parent_id index and 16-way hash trie. '
3436
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3438
branch_format='bzrlib.branch.BzrBranchFormat7',
3439
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3443
format_registry.register_metadir('development5-hash255',
3444
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment5Hash255',
3445
help='1.9 with CHK inventories with parent_id index and 255-way hash trie. '
3447
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3449
branch_format='bzrlib.branch.BzrBranchFormat7',
3450
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3454
# XXX: This format is scheduled for termination
3455
# format_registry.register_metadir('gc-no-rich-root',
3456
# 'bzrlib.repofmt.groupcompress_repo.RepositoryFormatPackGCPlain',
3457
# help='pack-1.9 with xml inv, group compress '
3459
# 'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3461
# branch_format='bzrlib.branch.BzrBranchFormat7',
3462
# tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3464
# experimental=True,
3466
format_registry.register_metadir('gc-chk16',
3467
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatPackGCCHK16',
3468
help='pack-1.9 with 16-way hashed CHK inv, group compress, rich roots. '
3470
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3472
branch_format='bzrlib.branch.BzrBranchFormat7',
3473
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3477
format_registry.register_metadir('gc-chk255',
3478
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatPackGCCHK255',
3479
help='pack-1.9 with 255-way hashed CHK inv, group compress, rich roots '
3481
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3483
branch_format='bzrlib.branch.BzrBranchFormat7',
3484
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3488
format_registry.register_metadir('gc-chk255-big',
3489
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatPackGCCHK255Big',
3490
help='pack-1.9 with 255-way hashed CHK inv, group compress, rich roots '
3492
'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
3494
branch_format='bzrlib.branch.BzrBranchFormat7',
3495
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3500
# The following format should be an alias for the rich root equivalent
3899
format_registry.register_metadir('development6-rich-root',
3900
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK1',
3901
help='pack-1.9 with 255-way hashed CHK inv, group compress, rich roots '
3903
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3905
branch_format='bzrlib.branch.BzrBranchFormat7',
3906
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3911
format_registry.register_metadir('development7-rich-root',
3912
'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK2',
3913
help='pack-1.9 with 255-way hashed CHK inv, bencode revision, group compress, '
3914
'rich roots. Please read '
3915
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3917
branch_format='bzrlib.branch.BzrBranchFormat7',
3918
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3923
format_registry.register_metadir('2a',
3924
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
3925
help='First format for bzr 2.0 series.\n'
3926
'Uses group-compress storage.\n'
3927
'Provides rich roots which are a one-way transition.\n',
3928
# 'storage in packs, 255-way hashed CHK inventory, bencode revision, group compress, '
3929
# 'rich roots. Supported by bzr 1.16 and later.',
3930
branch_format='bzrlib.branch.BzrBranchFormat7',
3931
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3935
# The following format should be an alias for the rich root equivalent
3501
3936
# of the default format
3502
3937
format_registry.register_metadir('default-rich-root',
3503
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack4',
3504
help='Default format, rich root variant. (needed for bzr-svn and bzr-git).',
3505
branch_format='bzrlib.branch.BzrBranchFormat6',
3506
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3938
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
3939
branch_format='bzrlib.branch.BzrBranchFormat7',
3940
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3509
3945
# The current format that is made on 'bzr init'.
3510
format_registry.set_default('pack-0.92')
3946
format_registry.set_default('2a')