~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Andrew Bennetts
  • Date: 2007-04-17 09:01:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070417090153-a7apw9czzedpt4nk
Deal with various review comments from Robert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
        return SmartServerResponse((), tmpf.read())
222
222
 
223
223
 
224
 
# This exists solely to help RemoteObjectHacking.  It should be removed
225
 
# eventually.  It should not be considered part of the real smart server
226
 
# protocol!
227
 
class ProbeDontUseRequest(SmartServerRequest):
228
 
 
229
 
    def do(self, path):
230
 
        from bzrlib.bzrdir import BzrDirFormat
231
 
        t = self._backing_transport.clone(path)
232
 
        default_format = BzrDirFormat.get_default_format()
233
 
        real_bzrdir = default_format.open(t, _found=True)
234
 
        try:
235
 
            real_bzrdir._format.probe_transport(t)
236
 
        except (errors.NotBranchError, errors.UnknownFormatError):
237
 
            answer = 'no'
238
 
        else:
239
 
            answer = 'yes'
240
 
        return SmartServerResponse((answer,))
241
 
 
242
 
 
243
224
class SmartServerIsReadonly(SmartServerRequest):
244
225
    # XXX: this request method belongs somewhere else.
245
226
 
318
299
request_handlers.register_lazy(
319
300
    'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly')
320
301
request_handlers.register_lazy(
321
 
    'probe_dont_use', 'bzrlib.smart.request', 'ProbeDontUseRequest')
 
302
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')