165
165
format.get_format_description(),
168
def clone(self, url, revision_id=None, force_new_repo=False,
169
preserve_stacking=False):
170
"""Clone this bzrdir and its contents to url verbatim.
172
:param url: The url create the clone at. If url's last component does
173
not exist, it will be created.
174
:param revision_id: The tip revision-id to use for any branch or
175
working tree. If not None, then the clone operation may tune
176
itself to download less data.
177
:param force_new_repo: Do not use a shared repository for the target
178
even if one is available.
179
:param preserve_stacking: When cloning a stacked branch, stack the
180
new branch on top of the other branch's stacked-on branch.
182
return self.clone_on_transport(get_transport(url),
183
revision_id=revision_id,
184
force_new_repo=force_new_repo,
185
preserve_stacking=preserve_stacking)
168
187
def clone_on_transport(self, transport, revision_id=None,
169
188
force_new_repo=False, preserve_stacking=False, stacked_on=None,
170
189
create_prefix=False, use_existing_dir=True):
1700
1719
def register_format(klass, format):
1701
1720
BzrProber.register_bzrdir_format(format)
1702
1721
# bzr native formats have a network name of their format string.
1703
controldir.network_format_registry.register(format.get_format_string(), format.__class__)
1722
network_format_registry.register(format.get_format_string(), format.__class__)
1704
1723
controldir.ControlDirFormat.register_format(format)
1706
1725
def _supply_sub_formats_to(self, other_format):
1719
1738
def unregister_format(klass, format):
1720
1739
BzrProber.unregister_bzrdir_format(format)
1721
1740
controldir.ControlDirFormat.unregister_format(format)
1722
controldir.network_format_registry.remove(format.get_format_string())
1741
network_format_registry.remove(format.get_format_string())
1725
1744
class BzrDirFormat4(BzrDirFormat):
2128
2147
__set_workingtree_format)
2150
network_format_registry = registry.FormatRegistry()
2151
"""Registry of formats indexed by their network name.
2153
The network name for a BzrDirFormat is an identifier that can be used when
2154
referring to formats with smart server operations. See
2155
BzrDirFormat.network_name() for more detail.
2131
2159
# Register bzr formats
2132
2160
BzrDirFormat.register_format(BzrDirFormat4())
2133
2161
BzrDirFormat.register_format(BzrDirFormat5())
2675
2703
class RemoteBzrDirFormat(BzrDirMetaFormat1):
2676
2704
"""Format representing bzrdirs accessed via a smart server"""
2678
supports_workingtrees = False
2680
2706
def __init__(self):
2681
2707
BzrDirMetaFormat1.__init__(self)
2682
2708
# XXX: It's a bit ugly that the network name is here, because we'd
2692
2718
def get_format_description(self):
2693
2719
if self._network_name:
2694
real_format = controldir.network_format_registry.get(self._network_name)
2720
real_format = network_format_registry.get(self._network_name)
2695
2721
return 'Remote: ' + real_format.get_format_description()
2696
2722
return 'bzr remote bzrdir'
3267
register_metadir(controldir.format_registry, 'development5-subtree',
3293
register_metadir(controldir.format_registry, 'development-subtree',
3268
3294
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3269
help='Development format, subtree variant. Can convert data to and '
3270
'from pack-0.92-subtree (and anything compatible with '
3271
'pack-0.92-subtree) format repositories. Repositories and branches in '
3272
'this format can only be read by bzr.dev. Please read '
3273
'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3275
branch_format='bzrlib.branch.BzrBranchFormat7',
3276
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3283
register_metadir(controldir.format_registry, 'development-subtree',
3284
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2aSubtree',
3285
3295
help='Current development format, subtree variant. Can convert data to and '
3286
3296
'from pack-0.92-subtree (and anything compatible with '
3287
3297
'pack-0.92-subtree) format repositories. Repositories and branches in '
3331
3341
# 'rich roots. Supported by bzr 1.16 and later.',
3332
3342
branch_format='bzrlib.branch.BzrBranchFormat7',
3333
3343
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3337
3347
# The following format should be an alias for the rich root equivalent