~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/branch.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:37:58 UTC
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105103758-wzftnmsip5iv9n2g
Revert addition of get_message_encoding function

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
class BzrBranch4(FullHistoryBzrBranch):
33
33
    """Branch format 4."""
34
34
 
35
 
    def _get_checkout_format(self):
 
35
    def _get_checkout_format(self, lightweight=False):
36
36
        """Return the most suitable metadir for a checkout of this branch.
37
37
        """
38
38
        from bzrlib.plugins.weave_fmt.repository import RepositoryFormat7
39
39
        from bzrlib.bzrdir import BzrDirMetaFormat1
40
40
        format = BzrDirMetaFormat1()
41
 
        format.repository_format = RepositoryFormat7()
 
41
        if lightweight:
 
42
            format.set_branch_format(self._format)
 
43
            format.repository_format = self.bzrdir._format.repository_format
 
44
        else:
 
45
            format.repository_format = RepositoryFormat7()
42
46
        return format
43
47
 
44
48
    def unbind(self):
70
74
    It does not support binding.
71
75
    """
72
76
 
73
 
    def initialize(self, a_bzrdir, name=None, repository=None):
 
77
    def initialize(self, a_bzrdir, name=None, repository=None,
 
78
                   append_revisions_only=None):
74
79
        """Create a branch of this format in a_bzrdir.
75
80
 
76
81
        :param a_bzrdir: The bzrdir to initialize the branch in
77
82
        :param name: Name of colocated branch to create, if any
78
83
        :param repository: Repository for this branch (unused)
79
84
        """
 
85
        if append_revisions_only:
 
86
            raise errors.UpgradeRequired(a_bzrdir.user_url)
80
87
        if repository is not None:
81
88
            raise NotImplementedError(
82
89
                "initialize(repository=<not None>) on %r" % (self,))
127
134
        return "Branch format 4"
128
135
 
129
136
    def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False,
130
 
            found_repository=None):
 
137
            found_repository=None, possible_transports=None):
131
138
        """See BranchFormat.open()."""
132
139
        if name is not None:
133
140
            raise errors.NoColocatedBranchSupport(self)
140
147
                         _control_files=a_bzrdir._control_files,
141
148
                         a_bzrdir=a_bzrdir,
142
149
                         name=name,
143
 
                         _repository=found_repository)
 
150
                         _repository=found_repository,
 
151
                         possible_transports=possible_transports)
144
152
 
145
153
    def __str__(self):
146
154
        return "Bazaar-NG branch format 4"