130
131
"""Give an error or warning on old formats.
132
:param format: may be any kind of format - workingtree, branch,
133
:param format: may be any kind of format - workingtree, branch,
135
:param allow_unsupported: If true, allow opening
136
formats that are strongly deprecated, and which may
136
:param allow_unsupported: If true, allow opening
137
formats that are strongly deprecated, and which may
137
138
have limited functionality.
139
140
:param recommend_upgrade: If true (default), warn
188
189
transport.ensure_base()
189
190
require_stacking = (stacked_on is not None)
190
metadir = self.cloning_metadir(require_stacking)
191
result = metadir.initialize_on_transport(transport)
191
format = self.cloning_metadir(require_stacking)
192
result = format.initialize_on_transport(transport)
192
193
repository_policy = None
194
195
local_repo = self.find_repository()
228
229
# make sure its content is available in the target repository
230
231
if local_branch is not None:
231
result_branch = local_branch.clone(result, revision_id=revision_id)
232
if repository_policy is not None:
233
repository_policy.configure_branch(result_branch)
234
if result_repo is None or result_repo.make_working_trees():
232
result_branch = local_branch.clone(result, revision_id=revision_id,
233
repository_policy=repository_policy)
235
# Cheaper to check if the target is not local, than to try making
237
result.root_transport.local_abspath('.')
238
if result_repo is None or result_repo.make_working_trees():
236
239
self.open_workingtree().clone(result)
237
except (errors.NoWorkingTree, errors.NotLocalUrl):
240
except (errors.NoWorkingTree, errors.NotLocalUrl):
241
244
# TODO: This should be given a Transport, and should chdir up; otherwise
248
251
def create(cls, base, format=None, possible_transports=None):
249
252
"""Create a new BzrDir at the url 'base'.
251
254
:param format: If supplied, the format of branch to create. If not
252
255
supplied, the default is used.
253
:param possible_transports: If supplied, a list of transports that
256
:param possible_transports: If supplied, a list of transports that
254
257
can be reused to share a remote connection.
256
259
if cls is not BzrDir:
356
359
"""Create a new BzrDir, Branch and Repository at the url 'base'.
358
361
This will use the current default BzrDirFormat unless one is
359
specified, and use whatever
362
specified, and use whatever
360
363
repository format that that uses via bzrdir.create_branch and
361
364
create_repository. If a shared repository is available that is used
452
455
This will use the current default BzrDirFormat unless one is
453
specified, and use whatever
456
specified, and use whatever
454
457
repository format that that uses via bzrdir.create_branch and
455
458
create_repository. If a shared repository is available that is used
456
459
preferentially. Whatever repository is used, its tree creation policy
459
462
The created Branch object is returned.
460
463
If a working tree cannot be made due to base not being a file:// url,
461
no error is raised unless force_new_tree is True, in which case no
464
no error is raised unless force_new_tree is True, in which case no
462
465
data is created on disk and NotLocalUrl is raised.
464
467
:param base: The URL to create the branch at.
465
468
:param force_new_repo: If True a new repository is always created.
466
:param force_new_tree: If True or False force creation of a tree or
469
:param force_new_tree: If True or False force creation of a tree or
467
470
prevent such creation respectively.
468
471
:param format: Override for the bzrdir format to create.
469
472
:param possible_transports: An optional reusable transports list.
491
494
'base' must be a local path or a file:// url.
493
496
This will use the current default BzrDirFormat unless one is
494
specified, and use whatever
497
specified, and use whatever
495
498
repository format that that uses for bzrdirformat.create_workingtree,
496
499
create_branch and create_repository.
509
512
def create_workingtree(self, revision_id=None, from_branch=None,
510
513
accelerator_tree=None, hardlink=False):
511
514
"""Create a working tree at this BzrDir.
513
516
:param revision_id: create it as of this revision id.
514
517
:param from_branch: override bzrdir branch (for lightweight checkouts)
515
518
:param accelerator_tree: A tree which can be used for retrieving file
530
533
# already exists, but it should instead either remove it or make
531
534
# a new backup directory.
533
# FIXME: bug 262450 -- the backup directory should have the same
536
# FIXME: bug 262450 -- the backup directory should have the same
534
537
# permissions as the .bzr directory (probably a bug in copy_tree)
535
538
old_path = self.root_transport.abspath('.bzr')
536
539
new_path = self.root_transport.abspath('backup.bzr')
651
654
IncompatibleFormat if the branch format they are given has
652
655
a format string, and vice versa.
654
If branch_format is None, the transport is returned with no
657
If branch_format is None, the transport is returned with no
655
658
checking. If it is not None, then the returned transport is
656
659
guaranteed to point to an existing directory ready for use.
708
711
IncompatibleFormat if the repository format they are given has
709
712
a format string, and vice versa.
711
If repository_format is None, the transport is returned with no
714
If repository_format is None, the transport is returned with no
712
715
checking. If it is not None, then the returned transport is
713
716
guaranteed to point to an existing directory ready for use.
715
718
raise NotImplementedError(self.get_repository_transport)
717
720
def get_workingtree_transport(self, tree_format):
718
721
"""Get the transport for use by workingtree format in this BzrDir.
721
724
IncompatibleFormat if the workingtree format they are given has a
722
725
format string, and vice versa.
724
If workingtree_format is None, the transport is returned with no
727
If workingtree_format is None, the transport is returned with no
725
728
checking. If it is not None, then the returned transport is
726
729
guaranteed to point to an existing directory ready for use.
735
738
def __init__(self, _transport, _format):
736
739
"""Initialize a Bzr control dir object.
738
741
Only really common logic should reside here, concrete classes should be
739
742
made with varying behaviours.
757
760
this in the future - for instance to make bzr talk with svn working
760
# this might be better on the BzrDirFormat class because it refers to
761
# all the possible bzrdir disk formats.
762
# This method is tested via the workingtree is_control_filename tests-
763
# this might be better on the BzrDirFormat class because it refers to
764
# all the possible bzrdir disk formats.
765
# This method is tested via the workingtree is_control_filename tests-
763
766
# it was extracted from WorkingTree.is_control_filename. If the method's
764
767
# contract is extended beyond the current trivial implementation, please
765
768
# add new tests for it to the appropriate place.
768
771
def needs_format_conversion(self, format=None):
769
772
"""Return true if this bzrdir needs convert_format run on it.
771
For instance, if the repository format is out of date but the
774
For instance, if the repository format is out of date but the
772
775
branch and working tree are not, this should return True.
774
777
:param format: Optional parameter indicating a specific desired
780
783
def open_unsupported(base):
781
784
"""Open a branch which is not supported."""
782
785
return BzrDir.open(base, _unsupported=True)
785
788
def open(base, _unsupported=False, possible_transports=None):
786
789
"""Open an existing bzrdir, rooted at 'base' (url).
788
791
:param _unsupported: a private parameter to the BzrDir class.
790
793
t = get_transport(base, possible_transports=possible_transports)
837
840
def open_containing(url, possible_transports=None):
838
841
"""Open an existing branch which contains url.
840
843
:param url: url to search from.
841
844
See open_containing_from_transport for more detail.
843
846
transport = get_transport(url, possible_transports)
844
847
return BzrDir.open_containing_from_transport(transport)
847
850
def open_containing_from_transport(a_transport):
848
851
"""Open an existing branch which contains a_transport.base.
852
855
Basically we keep looking up until we find the control directory or
853
856
run into the root. If there isn't one, raises NotBranchError.
854
If there is one and it is either an unrecognised format or an unsupported
857
If there is one and it is either an unrecognised format or an unsupported
855
858
format, UnknownFormatError or UnsupportedFormatError are raised.
856
859
If there is one, it is returned, along with the unused portion of url.
858
:return: The BzrDir that contains the path, and a Unicode path
861
:return: The BzrDir that contains the path, and a Unicode path
859
862
for the rest of the URL.
861
864
# this gets the normalised url back. I.e. '.' -> the full path.
970
973
def has_branch(self):
971
974
"""Tell if this bzrdir contains a branch.
973
976
Note: if you're going to open the branch, you should just go ahead
974
and try, and not ask permission first. (This method just opens the
975
branch and discards it, and that's somewhat expensive.)
977
and try, and not ask permission first. (This method just opens the
978
branch and discards it, and that's somewhat expensive.)
978
981
self.open_branch()
986
989
This will still raise an exception if the bzrdir has a workingtree that
987
990
is remote & inaccessible.
989
992
Note: if you're going to open the working tree, you should just go ahead
990
and try, and not ask permission first. (This method just opens the
991
workingtree and discards it, and that's somewhat expensive.)
993
and try, and not ask permission first. (This method just opens the
994
workingtree and discards it, and that's somewhat expensive.)
994
997
self.open_workingtree(recommend_upgrade=False)
1061
1064
def sprout(self, url, revision_id=None, force_new_repo=False,
1062
1065
recurse='down', possible_transports=None,
1063
1066
accelerator_tree=None, hardlink=False, stacked=False,
1064
source_branch=None):
1067
source_branch=None, create_tree_if_local=True):
1065
1068
"""Create a copy of this bzrdir prepared for use as a new line of
1082
1085
where possible.
1083
1086
:param stacked: If true, create a stacked branch referring to the
1084
1087
location of this control directory.
1088
:param create_tree_if_local: If true, a working-tree will be created
1089
when working locally.
1086
1091
target_transport = get_transport(url, possible_transports)
1087
1092
target_transport.ensure_base()
1134
1139
result_branch.set_parent(parent_location)
1136
1141
# Create/update the result working tree
1137
if isinstance(target_transport, local.LocalTransport) and (
1138
result_repo is None or result_repo.make_working_trees()):
1142
if (create_tree_if_local and
1143
isinstance(target_transport, local.LocalTransport) and
1144
(result_repo is None or result_repo.make_working_trees())):
1139
1145
wt = result.create_workingtree(accelerator_tree=accelerator_tree,
1140
1146
hardlink=hardlink)
1141
1147
wt.lock_write()
1254
1260
# and that will have set it for us, its only
1255
1261
# specific uses of create_workingtree in isolation
1256
1262
# that can do wonky stuff here, and that only
1257
# happens for creating checkouts, which cannot be
1263
# happens for creating checkouts, which cannot be
1258
1264
# done on this format anyway. So - acceptable wart.
1260
1266
result = self.open_workingtree(recommend_upgrade=False)
1284
1290
def destroy_workingtree_metadata(self):
1285
1291
"""See BzrDir.destroy_workingtree_metadata."""
1286
raise errors.UnsupportedOperation(self.destroy_workingtree_metadata,
1292
raise errors.UnsupportedOperation(self.destroy_workingtree_metadata,
1289
1295
def get_branch_transport(self, branch_format):
1336
1342
def sprout(self, url, revision_id=None, force_new_repo=False,
1337
1343
possible_transports=None, accelerator_tree=None,
1338
hardlink=False, stacked=False):
1344
hardlink=False, stacked=False, create_tree_if_local=True):
1339
1345
"""See BzrDir.sprout()."""
1341
1347
raise errors.UnstackableBranchFormat(
1342
1348
self._format, self.root_transport.base)
1349
if not create_tree_if_local:
1350
raise errors.MustHaveWorkingTree(
1351
self._format, self.root_transport.base)
1343
1352
from bzrlib.workingtree import WorkingTreeFormat2
1344
1353
self._make_tail(url)
1345
1354
result = self._format._initialize_for_clone(url)
1351
1360
self.open_branch().sprout(result, revision_id=revision_id)
1352
1361
except errors.NotBranchError:
1354
1364
# we always want a working tree
1355
1365
WorkingTreeFormat2().initialize(result,
1356
1366
accelerator_tree=accelerator_tree,
1425
1435
class BzrDirMeta1(BzrDir):
1426
1436
"""A .bzr meta version 1 control object.
1428
This is the first control object where the
1438
This is the first control object where the
1429
1439
individual aspects are really split out: there are separate repository,
1430
1440
workingtree and branch subdirectories and any subset of the three can be
1431
1441
present within a BzrDir.
1601
1611
* a format string,
1602
1612
* an open routine.
1604
Formats are placed in a dict by their format string for reference
1614
Formats are placed in a dict by their format string for reference
1605
1615
during bzrdir opening. These should be subclasses of BzrDirFormat
1606
1616
for consistency.
1608
1618
Once a format is deprecated, just deprecate the initialize and open
1609
methods on the format class. Do not deprecate the object, as the
1619
methods on the format class. Do not deprecate the object, as the
1610
1620
object will be created every system load.
1683
1693
current default format. In the case of plugins we can/should provide
1684
1694
some means for them to extend the range of returnable converters.
1686
:param format: Optional format to override the default format of the
1696
:param format: Optional format to override the default format of the
1689
1699
raise NotImplementedError(self.get_converter)
1691
1701
def initialize(self, url, possible_transports=None):
1692
1702
"""Create a bzr control dir at this url and return an opened copy.
1694
1704
Subclasses should typically override initialize_on_transport
1695
1705
instead of this method.
1700
1710
def initialize_on_transport(self, transport):
1701
1711
"""Initialize a new bzrdir in the base directory of a Transport."""
1702
# Since we don't have a .bzr directory, inherit the
1713
# can we hand off the request to the smart server rather than using
1715
client_medium = transport.get_smart_medium()
1716
except errors.NoSmartMedium:
1717
return self._initialize_on_transport_vfs(transport)
1719
# Current RPC's only know how to create bzr metadir1 instances, so
1720
# we still delegate to vfs methods if the requested format is not a
1722
if type(self) != BzrDirMetaFormat1:
1723
return self._initialize_on_transport_vfs(transport)
1724
remote_format = RemoteBzrDirFormat()
1725
self._supply_sub_formats_to(remote_format)
1726
return remote_format.initialize_on_transport(transport)
1728
def _initialize_on_transport_vfs(self, transport):
1729
"""Initialize a new bzrdir using VFS calls.
1731
:param transport: The transport to create the .bzr directory in.
1734
# Since we are creating a .bzr directory, inherit the
1703
1735
# mode from the root directory
1704
1736
temp_control = lockable_files.LockableFiles(transport,
1705
1737
'', lockable_files.TransportLock)
1735
1767
"""Is this format supported?
1737
1769
Supported formats must be initializable and openable.
1738
Unsupported formats may not support initialization or committing or
1770
Unsupported formats may not support initialization or committing or
1739
1771
some other features depending on the reason for not being supported.
1743
1775
def same_model(self, target_format):
1744
return (self.repository_format.rich_root_data ==
1776
return (self.repository_format.rich_root_data ==
1745
1777
target_format.rich_root_data)
1748
1780
def known_formats(klass):
1749
1781
"""Return all the known formats.
1751
1783
Concrete formats should override _known_formats.
1753
# There is double indirection here to make sure that control
1754
# formats used by more than one dir format will only be probed
1785
# There is double indirection here to make sure that control
1786
# formats used by more than one dir format will only be probed
1755
1787
# once. This can otherwise be quite expensive for remote connections.
1757
1789
for format in klass._control_formats:
1758
1790
result.update(format._known_formats())
1762
1794
def _known_formats(klass):
1763
1795
"""Return the known format instances for this control format."""
1766
1798
def open(self, transport, _found=False):
1767
1799
"""Return an instance of this format for the dir transport points at.
1769
1801
_found is a private parameter, do not use it.
1772
1804
found_format = BzrDirFormat.find_format(transport)
1773
1805
if not isinstance(found_format, self.__class__):
1774
1806
raise AssertionError("%s was asked to open %s, but it seems to need "
1776
1808
% (self, transport, found_format))
1809
# Allow subclasses - use the found format.
1810
self._supply_sub_formats_to(found_format)
1811
return found_format._open(transport)
1777
1812
return self._open(transport)
1779
1814
def _open(self, transport):
1793
1828
"""Register a format that does not use '.bzr' for its control dir.
1795
1830
TODO: This should be pulled up into a 'ControlDirFormat' base class
1796
which BzrDirFormat can inherit from, and renamed to register_format
1831
which BzrDirFormat can inherit from, and renamed to register_format
1797
1832
there. It has been done without that for now for simplicity of
1798
1833
implementation.
1818
1853
def __str__(self):
1819
1854
# Trim the newline
1820
return self.get_format_string().rstrip()
1855
return self.get_format_description().rstrip()
1857
def _supply_sub_formats_to(self, other_format):
1858
"""Give other_format the same values for sub formats as this has.
1860
This method is expected to be used when parameterising a
1861
RemoteBzrDirFormat instance with the parameters from a
1862
BzrDirMetaFormat1 instance.
1864
:param other_format: other_format is a format which should be
1865
compatible with whatever sub formats are supported by self.
1823
1870
def unregister_format(klass, format):
1855
1902
"""See BzrDirFormat.get_converter()."""
1856
1903
# there is one and only one upgrade path here.
1857
1904
return ConvertBzrDir4To5()
1859
1906
def initialize_on_transport(self, transport):
1860
1907
"""Format 4 branches cannot be created."""
1861
1908
raise errors.UninitializableFormat(self)
1886
1933
This format is a combined format for working tree, branch and repository.
1888
- Format 2 working trees [always]
1889
- Format 4 branches [always]
1935
- Format 2 working trees [always]
1936
- Format 4 branches [always]
1890
1937
- Format 5 repositories [always]
1891
1938
Unhashed stores in the repository.
1913
1960
def _initialize_for_clone(self, url):
1914
1961
return self.initialize_on_transport(get_transport(url), _cloning=True)
1916
1963
def initialize_on_transport(self, transport, _cloning=False):
1917
1964
"""Format 5 dirs always have working tree, branch and repository.
1919
1966
Except when they are being cloned.
1921
1968
from bzrlib.branch import BzrBranchFormat4
1944
1991
This format is a combined format for working tree, branch and repository.
1946
- Format 2 working trees [always]
1947
- Format 4 branches [always]
1993
- Format 2 working trees [always]
1994
- Format 4 branches [always]
1948
1995
- Format 6 repositories [always]
1966
2013
"""See BzrDirFormat.get_converter()."""
1967
2014
# there is one and only one upgrade path here.
1968
2015
return ConvertBzrDir6ToMeta()
1970
2017
def _initialize_for_clone(self, url):
1971
2018
return self.initialize_on_transport(get_transport(url), _cloning=True)
1973
2020
def initialize_on_transport(self, transport, _cloning=False):
1974
2021
"""Format 6 dirs always have working tree, branch and repository.
1976
2023
Except when they are being cloned.
1978
2025
from bzrlib.branch import BzrBranchFormat4
2039
2086
# target doesn't support stacking. So force a branch that *can*
2040
2087
# support stacking.
2041
2088
from bzrlib.branch import BzrBranchFormat7
2042
self._branch_format = BzrBranchFormat7()
2043
mutter("using %r for stacking" % (self._branch_format,))
2089
branch_format = BzrBranchFormat7()
2090
self.set_branch_format(branch_format)
2091
mutter("using %r for stacking" % (branch_format,))
2044
2092
from bzrlib.repofmt import pack_repo
2045
2093
if self.repository_format.rich_root_data:
2046
2094
bzrdir_format_name = '1.6.1-rich-root'
2081
2129
from bzrlib.repository import RepositoryFormat
2082
2130
return RepositoryFormat.get_default_format()
2084
def __set_repository_format(self, value):
2132
def _set_repository_format(self, value):
2085
2133
"""Allow changing the repository format for metadir formats."""
2086
2134
self._repository_format = value
2088
repository_format = property(__return_repository_format, __set_repository_format)
2136
repository_format = property(__return_repository_format,
2137
_set_repository_format)
2139
def _supply_sub_formats_to(self, other_format):
2140
"""Give other_format the same values for sub formats as this has.
2142
This method is expected to be used when parameterising a
2143
RemoteBzrDirFormat instance with the parameters from a
2144
BzrDirMetaFormat1 instance.
2146
:param other_format: other_format is a format which should be
2147
compatible with whatever sub formats are supported by self.
2150
if getattr(self, '_repository_format', None) is not None:
2151
other_format.repository_format = self.repository_format
2152
if self._branch_format is not None:
2153
other_format._branch_format = self._branch_format
2154
if self._workingtree_format is not None:
2155
other_format.workingtree_format = self.workingtree_format
2090
2157
def __get_workingtree_format(self):
2091
2158
if self._workingtree_format is None:
2329
2396
text_changed = False
2330
2397
parent_candiate_entries = ie.parent_candidates(parent_invs)
2331
2398
heads = graph.Graph(self).heads(parent_candiate_entries.keys())
2332
# XXX: Note that this is unordered - and this is tolerable because
2399
# XXX: Note that this is unordered - and this is tolerable because
2333
2400
# the previous code was also unordered.
2334
2401
previous_entries = dict((head, parent_candiate_entries[head]) for head
2352
2419
# a call to:. This needs the path figured out. rather than a work_tree
2353
2420
# a v4 revision_tree can be given, or something that looks enough like
2354
2421
# one to give the file content to the entry if it needs it.
2355
# and we need something that looks like a weave store for snapshot to
2422
# and we need something that looks like a weave store for snapshot to
2356
2423
# save against.
2357
2424
#ie.snapshot(rev, PATH, previous_revisions, REVISION_TREE, InMemoryWeaveStore(self.text_weaves))
2358
2425
if len(previous_revisions) == 1:
2474
2541
self.bzrdir.transport.mkdir('repository', mode=self.dir_mode)
2475
2542
self.make_lock('repository')
2476
2543
# we hard code the formats here because we are converting into
2477
# the meta format. The meta format upgrader can take this to a
2544
# the meta format. The meta format upgrader can take this to a
2478
2545
# future format within each component.
2479
2546
self.put_format('repository', RepositoryFormat7())
2480
2547
for entry in repository_names:
2635
2702
def get_format_description(self):
2636
2703
return 'bzr remote bzrdir'
2705
def get_format_string(self):
2706
raise NotImplementedError(self.get_format_string)
2639
2709
def probe_transport(klass, transport):
2640
2710
"""Return a RemoteBzrDirFormat object if it looks possible."""
2672
2742
response = client.call('BzrDirFormat.initialize', path)
2673
2743
if response[0] != 'ok':
2674
2744
raise errors.SmartProtocolError('unexpected response code %s' % (response,))
2675
return remote.RemoteBzrDir(transport)
2745
format = RemoteBzrDirFormat()
2746
self._supply_sub_formats_to(format)
2747
return remote.RemoteBzrDir(transport, format)
2677
2749
def _open(self, transport):
2678
return remote.RemoteBzrDir(transport)
2750
return remote.RemoteBzrDir(transport, self)
2680
2752
def __eq__(self, other):
2681
2753
if not isinstance(other, RemoteBzrDirFormat):
2683
2755
return self.get_format_description() == other.get_format_description()
2686
def repository_format(self):
2687
# Using a property to avoid early loading of remote
2688
return remote.RemoteRepositoryFormat()
2757
def __return_repository_format(self):
2758
# Always return a RemoteRepositoryFormat object, but if a specific bzr
2759
# repository format has been asked for, tell the RemoteRepositoryFormat
2760
# that it should use that for init() etc.
2761
result = remote.RemoteRepositoryFormat()
2762
custom_format = getattr(self, '_repository_format', None)
2764
# We will use the custom format to create repositories over the
2765
# wire; expose its details like rich_root_data for code to query
2766
if isinstance(custom_format, remote.RemoteRepositoryFormat):
2767
result._custom_format = custom_format._custom_format
2769
result._custom_format = custom_format
2770
result.rich_root_data = custom_format.rich_root_data
2773
def get_branch_format(self):
2774
result = BzrDirMetaFormat1.get_branch_format(self)
2775
if not isinstance(result, remote.RemoteBranchFormat):
2776
new_result = remote.RemoteBranchFormat()
2777
new_result._custom_format = result
2779
self.set_branch_format(new_result)
2783
repository_format = property(__return_repository_format,
2784
BzrDirMetaFormat1._set_repository_format) #.im_func)
2691
2787
BzrDirFormat.register_control_server_format(RemoteBzrDirFormat)
2703
2799
class BzrDirFormatRegistry(registry.Registry):
2704
2800
"""Registry of user-selectable BzrDir subformats.
2706
2802
Differs from BzrDirFormat._control_formats in that it provides sub-formats,
2707
2803
e.g. BzrDirMeta1 with weave repository. Also, it's more user-oriented.
2767
2863
def register(self, key, factory, help, native=True, deprecated=False,
2768
2864
hidden=False, experimental=False, alias=False):
2769
2865
"""Register a BzrDirFormat factory.
2771
2867
The factory must be a callable that takes one parameter: the key.
2772
2868
It must produce an instance of the BzrDirFormat when called.
2791
2887
def set_default(self, key):
2792
2888
"""Set the 'default' key to be a clone of the supplied key.
2794
2890
This method must be called once and only once.
2796
2892
registry.Registry.register(self, 'default', self.get(key),
2828
2924
def wrapped(key, help, info):
2829
2925
if info.native:
2830
2926
help = '(native) ' + help
2831
return ':%s:\n%s\n\n' % (key,
2832
textwrap.fill(help, initial_indent=' ',
2927
return ':%s:\n%s\n\n' % (key,
2928
textwrap.fill(help, initial_indent=' ',
2833
2929
subsequent_indent=' '))
2834
2930
if default_realkey is not None:
2835
2931
output += wrapped(default_realkey, '(default) %s' % default_help,
3014
3110
# appear in chronological order and format descriptions can build
3015
3111
# on previous ones.
3016
3112
format_registry = BzrDirFormatRegistry()
3113
# The pre-0.8 formats have their repository format network name registered in
3114
# repository.py. MetaDir formats have their repository format network name
3115
# inferred from their disk format string.
3017
3116
format_registry.register('weave', BzrDirFormat6,
3018
3117
'Pre-0.8 format. Slower than knit and does not'
3019
3118
' support checkouts or shared repositories.',
3125
3224
branch_format='bzrlib.branch.BzrBranchFormat7',
3126
3225
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3128
format_registry.register_metadir('1.12-preview',
3227
format_registry.register_metadir('development-wt5',
3129
3228
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
3130
3229
help='A working-tree format that supports views and content filtering.',
3131
3230
branch_format='bzrlib.branch.BzrBranchFormat7',
3132
tree_format='bzrlib.workingtree_4.WorkingTreeFormat5',
3231
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3133
3232
experimental=True,
3135
format_registry.register_metadir('1.12-preview-rich-root',
3234
format_registry.register_metadir('development-wt5-rich-root',
3136
3235
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
3137
help='A variant of 1.12-preview that supports rich-root data '
3236
help='A variant of development-wt5 that supports rich-root data '
3138
3237
'(needed for bzr-svn).',
3139
3238
branch_format='bzrlib.branch.BzrBranchFormat7',
3140
tree_format='bzrlib.workingtree_4.WorkingTreeFormat5',
3239
tree_format='bzrlib.workingtree.WorkingTreeFormat5',
3141
3240
experimental=True,
3143
3242
# The following two formats should always just be aliases.