~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/bzrdir.py

  • Committer: Martin Packman
  • Date: 2011-11-28 19:07:58 UTC
  • mfrom: (6318 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6319.
  • Revision ID: martin.packman@canonical.com-20111128190758-5gj44o5uzwz5sjfq
Merge bzr.dev to resolve conflicts with updated registry help strings

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
 
 
138
class SmartServerBzrDirRequestHasWorkingTree(SmartServerRequestBzrDir):
 
139
 
 
140
    def do_bzrdir_request(self, name=None):
 
141
        """Check whether there is a working tree present.
 
142
 
 
143
        New in 2.5.0.
 
144
 
 
145
        :return: If there is a working tree present, 'yes'.
 
146
            Otherwise 'no'.
 
147
        """
 
148
        if self._bzrdir.has_workingtree():
 
149
            return SuccessfulSmartServerResponse(('yes', ))
 
150
        else:
 
151
            return SuccessfulSmartServerResponse(('no', ))
 
152
 
 
153
 
 
154
class SmartServerBzrDirRequestDestroyRepository(SmartServerRequestBzrDir):
 
155
 
 
156
    def do_bzrdir_request(self, name=None):
 
157
        """Destroy the repository.
 
158
 
 
159
        New in 2.5.0.
 
160
 
 
161
        :return: On success, 'ok'.
 
162
        """
 
163
        try:
 
164
            self._bzrdir.destroy_repository()
 
165
        except errors.NoRepositoryPresent, e:
 
166
            return FailedSmartServerResponse(('norepository',))
 
167
        return SuccessfulSmartServerResponse(('ok',))
 
168
 
 
169
 
124
170
class SmartServerBzrDirRequestCloningMetaDir(SmartServerRequestBzrDir):
125
171
 
126
172
    def do_bzrdir_request(self, require_stacking):