~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2009-03-03 21:12:06 UTC
  • mto: (4083.1.2 robert-rollup)
  • mto: This revision was merged to the branch mainline in revision 4084.
  • Revision ID: robertc@robertcollins.net-20090303211206-cuzsauuklqtg4389
Audit and make sure we are registering network_name's as factories, not instances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1275
1275
    def register_format(klass, format):
1276
1276
        """Register a metadir format."""
1277
1277
        klass._formats[format.get_format_string()] = format
1278
 
        # Metadir formats have a network name of their format string.
1279
 
        network_format_registry.register(format.get_format_string(), format)
 
1278
        # Metadir formats have a network name of their format string, and get
 
1279
        # registered as class factories.
 
1280
        network_format_registry.register(format.get_format_string(), format.__class__)
1280
1281
 
1281
1282
    @classmethod
1282
1283
    def set_default_format(klass, format):
1730
1731
_legacy_formats = [BzrBranchFormat4(),
1731
1732
    ]
1732
1733
network_format_registry.register(
1733
 
    _legacy_formats[0].network_name(), _legacy_formats[0])
 
1734
    _legacy_formats[0].network_name(), _legacy_formats[0].__class__)
1734
1735
 
1735
1736
 
1736
1737
class BzrBranch(Branch):