~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-10-09 13:52:06 UTC
  • mfrom: (6202.1.3 revno-revision)
  • Revision ID: pqm@pqm.ubuntu.com-20111009135206-t3utsln6mtzv9eut
(jelmer) Add a --revision argument to 'bzr revno'. (Jelmer Vernooij)

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,))