542
542
branch = tree.branch
543
543
return tree, branch
545
def get_config(self):
546
"""Get configuration for this ControlDir."""
547
raise NotImplementedError(self.get_config)
549
def check_conversion_target(self, target_format):
550
"""Check that a bzrdir as a whole can be converted to a new format."""
551
raise NotImplementedError(self.check_conversion_target)
553
def clone(self, url, revision_id=None, force_new_repo=False,
554
preserve_stacking=False):
555
"""Clone this bzrdir and its contents to url verbatim.
557
:param url: The url create the clone at. If url's last component does
558
not exist, it will be created.
559
:param revision_id: The tip revision-id to use for any branch or
560
working tree. If not None, then the clone operation may tune
561
itself to download less data.
562
:param force_new_repo: Do not use a shared repository for the target
563
even if one is available.
564
:param preserve_stacking: When cloning a stacked branch, stack the
565
new branch on top of the other branch's stacked-on branch.
567
return self.clone_on_transport(get_transport(url),
568
revision_id=revision_id,
569
force_new_repo=force_new_repo,
570
preserve_stacking=preserve_stacking)
572
def clone_on_transport(self, transport, revision_id=None,
573
force_new_repo=False, preserve_stacking=False, stacked_on=None,
574
create_prefix=False, use_existing_dir=True):
575
"""Clone this bzrdir and its contents to transport verbatim.
577
:param transport: The transport for the location to produce the clone
578
at. If the target directory does not exist, it will be created.
579
:param revision_id: The tip revision-id to use for any branch or
580
working tree. If not None, then the clone operation may tune
581
itself to download less data.
582
:param force_new_repo: Do not use a shared repository for the target,
583
even if one is available.
584
:param preserve_stacking: When cloning a stacked branch, stack the
585
new branch on top of the other branch's stacked-on branch.
586
:param create_prefix: Create any missing directories leading up to
588
:param use_existing_dir: Use an existing directory if one exists.
590
raise NotImplementedError(self.clone_on_transport)
593
548
class ControlDirFormat(object):
967
922
# appear in chronological order and format descriptions can build
968
923
# on previous ones.
969
924
format_registry = ControlDirFormatRegistry()
971
network_format_registry = registry.FormatRegistry()
972
"""Registry of formats indexed by their network name.
974
The network name for a ControlDirFormat is an identifier that can be used when
975
referring to formats with smart server operations. See
976
ControlDirFormat.network_name() for more detail.