~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2010-08-25 20:30:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5418.
  • Revision ID: jelmer@samba.org-20100825203012-im1wveasuf1bvpai
Move network_format_registry to bzrlib.controldir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1719
1719
    def register_format(klass, format):
1720
1720
        BzrProber.register_bzrdir_format(format)
1721
1721
        # bzr native formats have a network name of their format string.
1722
 
        network_format_registry.register(format.get_format_string(), format.__class__)
 
1722
        controldir.network_format_registry.register(format.get_format_string(), format.__class__)
1723
1723
        controldir.ControlDirFormat.register_format(format)
1724
1724
 
1725
1725
    def _supply_sub_formats_to(self, other_format):
1738
1738
    def unregister_format(klass, format):
1739
1739
        BzrProber.unregister_bzrdir_format(format)
1740
1740
        controldir.ControlDirFormat.unregister_format(format)
1741
 
        network_format_registry.remove(format.get_format_string())
 
1741
        controldir.network_format_registry.remove(format.get_format_string())
1742
1742
 
1743
1743
 
1744
1744
class BzrDirFormat4(BzrDirFormat):
2147
2147
                                  __set_workingtree_format)
2148
2148
 
2149
2149
 
2150
 
network_format_registry = registry.FormatRegistry()
2151
 
"""Registry of formats indexed by their network name.
2152
 
 
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.
2156
 
"""
2157
 
 
2158
 
 
2159
2150
# Register bzr formats
2160
2151
BzrDirFormat.register_format(BzrDirFormat4())
2161
2152
BzrDirFormat.register_format(BzrDirFormat5())
2717
2708
 
2718
2709
    def get_format_description(self):
2719
2710
        if self._network_name:
2720
 
            real_format = network_format_registry.get(self._network_name)
 
2711
            real_format = controldir.network_format_registry.get(self._network_name)
2721
2712
            return 'Remote: ' + real_format.get_format_description()
2722
2713
        return 'bzr remote bzrdir'
2723
2714