/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/plugins/weave_fmt/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-02 14:27:58 UTC
  • mfrom: (6410 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6441.
  • Revision ID: jelmer@samba.org-20120102142758-hl7xrn7m5hjhecdv
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Weave-era BzrDir formats."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from bzrlib.bzrdir import (
20
22
    BzrDir,
21
23
    BzrDirFormat,
81
83
            stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
82
84
            make_working_trees=make_working_trees, shared_repo=shared_repo)
83
85
 
 
86
    @classmethod
 
87
    def from_string(cls, format_string):
 
88
        if format_string != cls.get_format_string():
 
89
            raise AssertionError("unexpected format string %r" % format_string)
 
90
        return cls()
 
91
 
84
92
 
85
93
class BzrDirFormat5(BzrDirFormatAllInOne):
86
94
    """Bzr control format 5.
98
106
    def __eq__(self, other):
99
107
        return type(self) == type(other)
100
108
 
101
 
    def get_format_string(self):
 
109
    @classmethod
 
110
    def get_format_string(cls):
102
111
        """See BzrDirFormat.get_format_string()."""
103
112
        return "Bazaar-NG branch, format 5\n"
104
113
 
161
170
    def __eq__(self, other):
162
171
        return type(self) == type(other)
163
172
 
164
 
    def get_format_string(self):
 
173
    @classmethod
 
174
    def get_format_string(cls):
165
175
        """See BzrDirFormat.get_format_string()."""
166
176
        return "Bazaar-NG branch, format 6\n"
167
177
 
669
679
    def __eq__(self, other):
670
680
        return type(self) == type(other)
671
681
 
672
 
    def get_format_string(self):
 
682
    @classmethod
 
683
    def get_format_string(cls):
673
684
        """See BzrDirFormat.get_format_string()."""
674
685
        return "Bazaar-NG branch, format 0.0.4\n"
675
686
 
708
719
        return RepositoryFormat4()
709
720
    repository_format = property(__return_repository_format)
710
721
 
 
722
    @classmethod
 
723
    def from_string(cls, format_string):
 
724
        if format_string != cls.get_format_string():
 
725
            raise AssertionError("unexpected format string %r" % format_string)
 
726
        return cls()
 
727
 
711
728
 
712
729
class BzrDirPreSplitOut(BzrDir):
713
730
    """A common class for the all-in-one formats."""
867
884
        return not isinstance(self._format, format.__class__)
868
885
 
869
886
    def open_branch(self, name=None, unsupported=False,
870
 
                    ignore_fallbacks=False):
 
887
                    ignore_fallbacks=False, possible_transports=None):
871
888
        """See BzrDir.open_branch."""
872
889
        from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4
873
890
        format = BzrBranchFormat4()
874
891
        format.check_support_status(unsupported)
875
 
        return format.open(self, name, _found=True)
 
892
        return format.open(self, name, _found=True,
 
893
            possible_transports=possible_transports)
876
894
 
877
895
    def sprout(self, url, revision_id=None, force_new_repo=False,
878
896
               possible_transports=None, accelerator_tree=None,