49
49
- a branch-lock lock file [ to be shared with the bzrdir ]
52
def get_format_description(self):
53
"""See BranchFormat.get_format_description()."""
54
return "Branch format 4"
56
def _initialize_helper(self, a_bzrdir, utf8_files, name=None):
57
"""Initialize a branch in a bzrdir, with specified files
52
def initialize(self, a_bzrdir, name=None, repository=None):
53
"""Create a branch of this format in a_bzrdir.
59
55
:param a_bzrdir: The bzrdir to initialize the branch in
60
:param utf8_files: The files to create as a list of
61
(filename, content) tuples
62
56
:param name: Name of colocated branch to create, if any
63
:return: a branch in this format
57
:param repository: Repository for this branch (unused)
59
if repository is not None:
60
raise NotImplementedError(
61
"initialize(repository=<not None>) on %r" % (self,))
62
if not [isinstance(a_bzrdir._format, format) for format in
63
self._compatible_bzrdirs]:
64
raise errors.IncompatibleFormat(self, a_bzrdir._format)
65
utf8_files = [('revision-history', ''),
65
68
mutter('creating branch %r in %s', self, a_bzrdir.user_url)
66
69
branch_transport = a_bzrdir.get_branch_transport(self, name=name)
67
70
control_files = lockable_files.LockableFiles(branch_transport,
86
89
self._run_post_branch_init_hooks(a_bzrdir, name, branch)
89
def initialize(self, a_bzrdir, name=None, repository=None):
90
"""Create a branch of this format in a_bzrdir."""
91
if repository is not None:
92
raise NotImplementedError(
93
"initialize(repository=<not None>) on %r" % (self,))
94
utf8_files = [('revision-history', ''),
97
return self._initialize_helper(a_bzrdir, utf8_files, name=name)
99
92
def __init__(self):
100
93
super(BzrBranchFormat4, self).__init__()
101
from bzrlib.plugins.weave_fmt.bzrdir import BzrDirFormat6
94
from bzrlib.plugins.weave_fmt.bzrdir import (
95
BzrDirFormat4, BzrDirFormat5, BzrDirFormat6,
102
97
self._matchingbzrdir = BzrDirFormat6()
98
self._compatible_bzrdirs = [BzrDirFormat4, BzrDirFormat5,
104
101
def network_name(self):
105
102
"""The network name for this format is the control dirs disk label."""
106
103
return self._matchingbzrdir.get_format_string()
105
def get_format_description(self):
106
return "Branch format 4"
108
108
def open(self, a_bzrdir, name=None, _found=False, ignore_fallbacks=False,
109
109
found_repository=None):
110
110
"""See BranchFormat.open()."""