/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

Add a Transport.is_readonly remote call, let {Branch,Repository}.lock_write remote call return UnlockableTransport, and miscellaneous test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        return SmartServerResponse((answer,))
231
231
 
232
232
 
 
233
class SmartServerIsReadonly(SmartServerRequest):
 
234
    # XXX: this request method belongs somewhere else.
 
235
 
 
236
    def do(self):
 
237
        if self._backing_transport.is_readonly():
 
238
            answer = 'yes'
 
239
        else:
 
240
            answer = 'no'
 
241
        return SmartServerResponse((answer,))
 
242
 
 
243
 
233
244
request_handlers = registry.Registry()
234
245
request_handlers.register_lazy(
235
246
    'append', 'bzrlib.smart.vfs', 'AppendRequest')
295
306
request_handlers.register_lazy(
296
307
    'stat', 'bzrlib.smart.vfs', 'StatRequest')
297
308
request_handlers.register_lazy(
 
309
    'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly')
 
310
request_handlers.register_lazy(
298
311
    'probe_dont_use', 'bzrlib.smart.request', 'ProbeDontUseRequest')