121
120
return '/'.join(segments)
123
class SmartServerBzrDirRequestDestroyBranch(SmartServerRequestBzrDir):
125
def do_bzrdir_request(self, name=None):
126
"""Destroy the branch with the specified name.
129
:return: On success, 'ok'.
132
self._bzrdir.destroy_branch(name)
133
except errors.NotBranchError, e:
134
return FailedSmartServerResponse(('nobranch',))
135
return SuccessfulSmartServerResponse(('ok',))
138
class SmartServerBzrDirRequestHasWorkingTree(SmartServerRequestBzrDir):
140
def do_bzrdir_request(self, name=None):
141
"""Check whether there is a working tree present.
145
:return: If there is a working tree present, 'yes'.
148
if self._bzrdir.has_workingtree():
149
return SuccessfulSmartServerResponse(('yes', ))
151
return SuccessfulSmartServerResponse(('no', ))
154
class SmartServerBzrDirRequestDestroyRepository(SmartServerRequestBzrDir):
156
def do_bzrdir_request(self, name=None):
157
"""Destroy the repository.
161
:return: On success, 'ok'.
164
self._bzrdir.destroy_repository()
165
except errors.NoRepositoryPresent, e:
166
return FailedSmartServerResponse(('norepository',))
167
return SuccessfulSmartServerResponse(('ok',))
124
170
class SmartServerBzrDirRequestCloningMetaDir(SmartServerRequestBzrDir):
126
172
def do_bzrdir_request(self, require_stacking):