2745
2746
BzrDirFormatInfo(native, deprecated, hidden, experimental))
2747
2748
self._aliases.add(key)
2749
self._registration_order.append(key)
2749
2751
def register_lazy(self, key, module_name, member_name, help, native=True,
2750
2752
deprecated=False, hidden=False, experimental=False, alias=False):
2777
2780
return self.get(key)()
2779
2782
def help_topic(self, topic):
2780
output = textwrap.dedent("""\
2781
These formats can be used for creating branches, working trees, and
2785
2784
default_realkey = None
2786
2785
default_help = self.get_help('default')
2787
2786
help_pairs = []
2788
for key in self.keys():
2787
for key in self._registration_order:
2789
2788
if key == 'default':
2791
2790
help = self.get_help(key)
2815
2814
experimental_pairs.append((key, help))
2817
2816
output += wrapped(key, help, info)
2817
output += "\nSee ``bzr help formats`` for more about storage formats."
2818
2819
if len(experimental_pairs) > 0:
2819
output += "Experimental formats are shown below.\n\n"
2820
other_output += "Experimental formats are shown below.\n\n"
2820
2821
for key, help in experimental_pairs:
2821
2822
info = self.get_info(key)
2822
output += wrapped(key, help, info)
2823
other_output += wrapped(key, help, info)
2826
"No experimental formats are available.\n\n"
2823
2827
if len(deprecated_pairs) > 0:
2824
output += "Deprecated formats are shown below.\n\n"
2828
other_output += "\nDeprecated formats are shown below.\n\n"
2825
2829
for key, help in deprecated_pairs:
2826
2830
info = self.get_info(key)
2827
output += wrapped(key, help, info)
2831
other_output += wrapped(key, help, info)
2834
"\nNo deprecated formats are available.\n\n"
2836
"\nSee ``bzr help formats`` for more about storage formats."
2838
if topic == 'other-formats':
2832
2844
class RepositoryAcquisitionPolicy(object):
2961
2973
return self._repository
2976
# Please register new formats after old formats so that formats
2977
# appear in chronological order and format descriptions can build
2964
2979
format_registry = BzrDirFormatRegistry()
2965
2980
format_registry.register('weave', BzrDirFormat6,
2966
2981
'Pre-0.8 format. Slower than knit and does not'
2967
2982
' support checkouts or shared repositories.',
2968
2983
deprecated=True)
2969
format_registry.register_metadir('knit',
2970
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2971
'Format using knits. Recommended for interoperation with bzr <= 0.14.',
2972
branch_format='bzrlib.branch.BzrBranchFormat5',
2973
tree_format='bzrlib.workingtree.WorkingTreeFormat3')
2974
2984
format_registry.register_metadir('metaweave',
2975
2985
'bzrlib.repofmt.weaverepo.RepositoryFormat7',
2976
2986
'Transitional format in 0.8. Slower than knit.',
2977
2987
branch_format='bzrlib.branch.BzrBranchFormat5',
2978
2988
tree_format='bzrlib.workingtree.WorkingTreeFormat3',
2979
2989
deprecated=True)
2990
format_registry.register_metadir('knit',
2991
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2992
'Format using knits. Recommended for interoperation with bzr <= 0.14.',
2993
branch_format='bzrlib.branch.BzrBranchFormat5',
2994
tree_format='bzrlib.workingtree.WorkingTreeFormat3',
2980
2996
format_registry.register_metadir('dirstate',
2981
2997
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2982
2998
help='New in 0.15: Fast local operations. Compatible with bzr 0.8 and '
2985
3001
# this uses bzrlib.workingtree.WorkingTreeFormat4 because importing
2986
3002
# directly from workingtree_4 triggers a circular import.
2987
3003
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2989
3005
format_registry.register_metadir('dirstate-tags',
2990
3006
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
2991
3007
help='New in 0.15: Fast local operations and improved scaling for '
2993
3009
' Incompatible with bzr < 0.15.',
2994
3010
branch_format='bzrlib.branch.BzrBranchFormat6',
2995
3011
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
2997
3013
format_registry.register_metadir('rich-root',
2998
3014
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit4',
2999
3015
help='New in 1.0. Better handling of tree roots. Incompatible with'
3001
3017
branch_format='bzrlib.branch.BzrBranchFormat6',
3002
3018
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3004
3020
format_registry.register_metadir('dirstate-with-subtree',
3005
3021
'bzrlib.repofmt.knitrepo.RepositoryFormatKnit3',
3006
3022
help='New in 0.15: Fast local operations and improved scaling for '
3038
3054
format_registry.register_metadir('rich-root-pack',
3039
3055
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack4',
3040
help='New in 1.0: Pack-based format with data compatible with '
3041
'rich-root format repositories. Incompatible with'
3056
help='New in 1.0: A variant of pack-0.92 that supports rich-root data '
3057
'(needed for bzr-svn).',
3043
3058
branch_format='bzrlib.branch.BzrBranchFormat6',
3044
3059
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3046
3061
format_registry.register_metadir('1.6',
3047
3062
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5',
3048
help='A branch and pack based repository that supports stacking. ',
3063
help='A format that allows a branch to indicate that there is another '
3064
'(stacked) repository that should be used to access data that is '
3065
'not present locally.',
3049
3066
branch_format='bzrlib.branch.BzrBranchFormat7',
3050
3067
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3052
3069
format_registry.register_metadir('1.6.1-rich-root',
3053
3070
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5RichRoot',
3054
help='A branch and pack based repository that supports stacking '
3055
'and rich root data (needed for bzr-svn). ',
3071
help='A variant of 1.6 that supports rich-root data '
3072
'(needed for bzr-svn).',
3056
3073
branch_format='bzrlib.branch.BzrBranchFormat7',
3057
3074
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3059
3076
format_registry.register_metadir('1.9',
3060
3077
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
3061
help='A branch and pack based repository that uses btree indexes. ',
3078
help='A repository format using B+tree indexes. These indexes '
3079
'are smaller in size, have smarter caching and provide faster '
3080
'performance for most operations.',
3062
3081
branch_format='bzrlib.branch.BzrBranchFormat7',
3063
3082
tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3065
3084
format_registry.register_metadir('1.9-rich-root',
3066
3085
'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
3067
help='A branch and pack based repository that uses btree indexes '
3068
'and rich root data (needed for bzr-svn). ',
3086
help='A variant of 1.9 that supports rich-root data '
3087
'(needed for bzr-svn).',
3069
3088
branch_format='bzrlib.branch.BzrBranchFormat7',
3070
3089
tree_format='bzrlib.workingtree.WorkingTreeFormat4',