~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 09:50:04 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6426.
  • Revision ID: martin.packman@canonical.com-20120105095004-mia9xb7y0efmto0v
Merge bzr.dev to resolve conflicts in bzrlib.builtins

Show diffs side-by-side

added added

removed removed

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