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)
187
168
def clone_on_transport(self, transport, revision_id=None,
188
169
force_new_repo=False, preserve_stacking=False, stacked_on=None,
189
170
create_prefix=False, use_existing_dir=True):
1719
1700
def register_format(klass, format):
1720
1701
BzrProber.register_bzrdir_format(format)
1721
1702
# bzr native formats have a network name of their format string.
1722
network_format_registry.register(format.get_format_string(), format.__class__)
1703
controldir.network_format_registry.register(format.get_format_string(), format.__class__)
1723
1704
controldir.ControlDirFormat.register_format(format)
1725
1706
def _supply_sub_formats_to(self, other_format):
1738
1719
def unregister_format(klass, format):
1739
1720
BzrProber.unregister_bzrdir_format(format)
1740
1721
controldir.ControlDirFormat.unregister_format(format)
1741
network_format_registry.remove(format.get_format_string())
1722
controldir.network_format_registry.remove(format.get_format_string())
1744
1725
class BzrDirFormat4(BzrDirFormat):
2147
2128
__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.
2159
2131
# Register bzr formats
2160
2132
BzrDirFormat.register_format(BzrDirFormat4())
2161
2133
BzrDirFormat.register_format(BzrDirFormat5())
2703
2675
class RemoteBzrDirFormat(BzrDirMetaFormat1):
2704
2676
"""Format representing bzrdirs accessed via a smart server"""
2678
supports_workingtrees = False
2706
2680
def __init__(self):
2707
2681
BzrDirMetaFormat1.__init__(self)
2708
2682
# XXX: It's a bit ugly that the network name is here, because we'd
2718
2692
def get_format_description(self):
2719
2693
if self._network_name:
2720
real_format = network_format_registry.get(self._network_name)
2694
real_format = controldir.network_format_registry.get(self._network_name)
2721
2695
return 'Remote: ' + real_format.get_format_description()
2722
2696
return 'bzr remote bzrdir'
3267
register_metadir(controldir.format_registry, 'development5-subtree',
3268
'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',
3293
3283
register_metadir(controldir.format_registry, 'development-subtree',
3294
'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3284
'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2aSubtree',
3295
3285
help='Current development format, subtree variant. Can convert data to and '
3296
3286
'from pack-0.92-subtree (and anything compatible with '
3297
3287
'pack-0.92-subtree) format repositories. Repositories and branches in '
3341
3331
# 'rich roots. Supported by bzr 1.16 and later.',
3342
3332
branch_format='bzrlib.branch.BzrBranchFormat7',
3343
3333
tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3347
3337
# The following format should be an alias for the rich root equivalent