/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

  • Committer: Aaron Bentley
  • Date: 2008-11-03 18:59:14 UTC
  • mfrom: (3818 +trunk)
  • mto: (0.16.99 shelf-ui)
  • mto: This revision was merged to the branch mainline in revision 3820.
  • Revision ID: aaron@aaronbentley.com-20081103185914-inz25vtsiowydw1p
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
            # with a plain string
304
304
            str_or_unicode = e.object
305
305
            if isinstance(str_or_unicode, unicode):
306
 
                # XXX: UTF-8 might have \x01 (our seperator byte) in it.  We
307
 
                # should escape it somehow.
 
306
                # XXX: UTF-8 might have \x01 (our protocol v1 and v2 seperator
 
307
                # byte) in it, so this encoding could cause broken responses.
 
308
                # Newer clients use protocol v3, so will be fine.
308
309
                val = 'u:' + str_or_unicode.encode('utf-8')
309
310
            else:
310
311
                val = 's:' + str_or_unicode.encode('base64')
316
317
                return FailedSmartServerResponse(('ReadOnlyError', ))
317
318
            else:
318
319
                raise
 
320
        except errors.ReadError, e:
 
321
            # cannot read the file
 
322
            return FailedSmartServerResponse(('ReadError', e.path))
 
323
        except errors.PermissionDenied, e:
 
324
            return FailedSmartServerResponse(
 
325
                ('PermissionDenied', e.path, e.extra))
319
326
 
320
327
    def headers_received(self, headers):
321
328
        # Just a no-op at the moment.
436
443
    'readv', 'bzrlib.smart.vfs', 'ReadvRequest')
437
444
request_handlers.register_lazy(
438
445
    'rename', 'bzrlib.smart.vfs', 'RenameRequest')
 
446
request_handlers.register_lazy(
 
447
    'PackRepository.autopack', 'bzrlib.smart.packrepository',
 
448
    'SmartServerPackRepositoryAutopack')
439
449
request_handlers.register_lazy('Repository.gather_stats',
440
450
                               'bzrlib.smart.repository',
441
451
                               'SmartServerRepositoryGatherStats')