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())
2720
2692
def get_format_description(self):
2721
2693
if self._network_name:
2722
real_format = network_format_registry.get(self._network_name)
2694
real_format = controldir.network_format_registry.get(self._network_name)
2723
2695
return 'Remote: ' + real_format.get_format_description()
2724
2696
return 'bzr remote bzrdir'