/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/controldir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-11 15:36:12 UTC
  • mfrom: (5712.4.8 bzrdir-weave)
  • mto: This revision was merged to the branch mainline in revision 5718.
  • Revision ID: jelmer@samba.org-20110311153612-7xniucwst6rrjshk
merge bzrdir-weave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
710
710
    _default_format = None
711
711
    """The default format used for new control directories."""
712
712
 
713
 
    _formats = []
714
 
    """The registered control formats - .bzr, ....
715
 
 
716
 
    This is a list of _ObjectGetters of ControlDirFormat objects.
717
 
    """
718
 
 
719
713
    _server_probers = []
720
714
    """The registered server format probers, e.g. RemoteBzrProber.
721
715
 
773
767
 
774
768
    @classmethod
775
769
    def register_format(klass, format):
776
 
        """Register a control dir format.
777
 
 
778
 
        """
779
 
        klass._formats.append(registry._ObjectGetter(format))
780
 
 
781
 
    @classmethod
782
 
    def register_lazy_format(klass, module_name, member_name):
783
 
        """Lazily register a control dir format.
784
 
 
785
 
        """
786
 
        klass._formats.append(registry._LazyObjectGetter(
787
 
            module_name, member_name))
 
770
        """Register a format that does not use '.bzr' for its control dir.
 
771
 
 
772
        """
 
773
        raise errors.BzrError("ControlDirFormat.register_format() has been "
 
774
            "removed in Bazaar 2.4. Please upgrade your plugins.")
788
775
 
789
776
    @classmethod
790
777
    def register_prober(klass, prober):
816
803
        return self.get_format_description().rstrip()
817
804
 
818
805
    @classmethod
819
 
    def unregister_format(klass, format):
820
 
        klass._formats.remove(registry._ObjectGetter(format))
821
 
 
822
 
    @classmethod
823
 
    def unregister_lazy_format(klass, module_name, member_name):
824
 
        klass._formats.remove(registry._LazyObjectGetter(
825
 
            module_name, member_name))
826
 
 
827
 
    @classmethod
828
806
    def known_formats(klass):
829
807
        """Return all the known formats.
830
808
        """
831
 
        return set([objgetter.get_obj() for objgetter in klass._formats])
 
809
        result = set()
 
810
        for prober_kls in klass._probers + klass._server_probers:
 
811
            result.update(prober_kls.known_formats())
 
812
        return result
832
813
 
833
814
    @classmethod
834
815
    def find_format(klass, transport, _server_formats=True):
942
923
        """
943
924
        raise NotImplementedError(self.probe_transport)
944
925
 
 
926
    @classmethod
 
927
    def known_formats(cls):
 
928
        """Return the control dir formats known by this prober.
 
929
 
 
930
        Multiple probers can return the same formats, so this should
 
931
        return a set.
 
932
 
 
933
        :return: A set of known formats.
 
934
        """
 
935
        raise NotImplementedError(cls.known_formats)
 
936
 
945
937
 
946
938
class ControlDirFormatInfo(object):
947
939