/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-04 18:12:44 UTC
  • mto: (5582.10.39 weave-fmt-plugin)
  • mto: This revision was merged to the branch mainline in revision 5651.
  • Revision ID: jelmer@samba.org-20110204181244-d3jfr901l7ve2pw0
Add WorkingTreeFormat.register_extra_format and friends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2882
2882
    _formats = {}
2883
2883
    """The known formats."""
2884
2884
 
 
2885
    _extra_formats = []
 
2886
    """Extra formats, not for use in working trees."""
 
2887
 
2885
2888
    requires_rich_root = False
2886
2889
 
2887
2890
    upgrade_recommended = False
2944
2947
        klass._formats[format.get_format_string()] = format
2945
2948
 
2946
2949
    @classmethod
 
2950
    def register_extra_format(klass, format):
 
2951
        klass._extra_formats.append(format)
 
2952
 
 
2953
    @classmethod
 
2954
    def unregister_extra_format(klass, format):
 
2955
        klass._extra_formats.remove(format)
 
2956
 
 
2957
    @classmethod
 
2958
    def get_formats(klass):
 
2959
        return klass._formats.values() + klass._extra_formats
 
2960
 
 
2961
    @classmethod
2947
2962
    def set_default_format(klass, format):
2948
2963
        klass._default_format = format
2949
2964
 
3179
3194
WorkingTreeFormat.set_default_format(__default_format)
3180
3195
# formats which have no format string are not discoverable
3181
3196
# and not independently creatable, so are not registered.
3182
 
_legacy_formats = [WorkingTreeFormat2(),
3183
 
                   ]
 
3197
WorkingTreeFormat.register_extra_format(WorkingTreeFormat2())