~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

HPSS call 'BzrDir.destroy_branch'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.bzrdir import (
22
22
    BzrDir,
23
23
    BzrDirFormat,
24
 
    BzrDirMetaFormat1,
25
24
    BzrProber,
26
25
    )
27
26
from bzrlib.controldir import (
121
120
        return '/'.join(segments)
122
121
 
123
122
 
 
123
class SmartServerBzrDirRequestDestroyBranch(SmartServerRequestBzrDir):
 
124
 
 
125
    def do_bzrdir_request(self, name=None):
 
126
        """Destroy the branch with the specified name.
 
127
 
 
128
        New in 2.5.0.
 
129
        :return: On success, 'ok'.
 
130
        """
 
131
        try:
 
132
            self._bzrdir.destroy_branch(name)
 
133
        except errors.NotBranchError, e:
 
134
            return FailedSmartServerResponse(('nobranch',))
 
135
        return SuccessfulSmartServerResponse(('ok',))
 
136
 
 
137
 
124
138
class SmartServerBzrDirRequestCloningMetaDir(SmartServerRequestBzrDir):
125
139
 
126
140
    def do_bzrdir_request(self, require_stacking):