3139
3139
bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
3140
3140
recommend_upgrade=recommend_upgrade, basedir=basedir)
3142
def get_controldir_for_branch(self):
3143
"""Get the control directory format for creating branches.
3145
This is to support testing of working tree formats that can not exist
3146
in the same control directory as a branch.
3148
return self._matchingbzrdir
3151
class WorkingTreeFormatMetaDir(bzrdir.BzrFormat, WorkingTreeFormat):
3152
"""Base class for working trees that live in bzr meta directories."""
3155
WorkingTreeFormat.__init__(self)
3156
bzrdir.BzrFormat.__init__(self)
3159
def find_format_string(klass, controldir):
3160
"""Return format name for the working tree object in controldir."""
3162
transport = controldir.get_workingtree_transport(None)
3163
return transport.get_bytes("format")
3164
except errors.NoSuchFile:
3165
raise errors.NoWorkingTree(base=transport.base)
3168
def find_format(klass, controldir):
3169
"""Return the format for the working tree object in controldir."""
3170
format_string = klass.find_format_string(controldir)
3171
return klass._find_format(format_registry, 'working tree',
3174
def check_support_status(self, allow_unsupported, recommend_upgrade=True,
3176
WorkingTreeFormat.check_support_status(self,
3177
allow_unsupported=allow_unsupported, recommend_upgrade=recommend_upgrade,
3179
bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
3180
recommend_upgrade=recommend_upgrade, basedir=basedir)
3143
3183
format_registry.register_lazy("Bazaar Working Tree Format 4 (bzr 0.15)\n",
3144
3184
"bzrlib.workingtree_4", "WorkingTreeFormat4")