211
class SmartServerBzrDirRequestCheckoutMetaDir(SmartServerRequestBzrDir):
212
"""Get the format to use for checkouts.
216
:return: on success, a 3-tuple of network names for (control,
217
repository, branch) directories, where '' signifies "not present".
218
If this BzrDir contains a branch reference then this will fail with
219
BranchReference; clients should resolve branch references before
220
calling this RPC (they should not try to create a checkout of a
224
def do_bzrdir_request(self):
226
branch_ref = self._bzrdir.get_branch_reference()
227
except errors.NotBranchError:
229
if branch_ref is not None:
230
# The server shouldn't try to resolve references, and it quite
231
# possibly can't reach them anyway. The client needs to resolve
232
# the branch reference to determine the cloning_metadir.
233
return FailedSmartServerResponse(('BranchReference',))
234
control_format = self._bzrdir.checkout_metadir()
235
control_name = control_format.network_name()
236
if not control_format.fixed_components:
237
branch_name = control_format.get_branch_format().network_name()
238
repo_name = control_format.repository_format.network_name()
242
return SuccessfulSmartServerResponse(
243
(control_name, repo_name, branch_name))
211
246
class SmartServerRequestCreateBranch(SmartServerRequestBzrDir):
213
248
def do(self, path, network_name):