/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 breezy/bzr/smart/request.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
 
36
36
import threading
37
 
try:
38
 
    from _thread import get_ident
39
 
except ImportError:  # Python < 3
40
 
    from thread import get_ident
41
37
 
42
38
from ... import (
43
39
    branch as _mod_branch,
49
45
    trace,
50
46
    urlutils,
51
47
    )
52
 
from ...sixish import text_type
53
48
from ...lazy_import import lazy_import
54
49
lazy_import(globals(), """
55
50
from breezy.bzr import bzrdir
56
 
from breezy.bzr.bundle import serializer
 
51
from breezy.bundle import serializer
57
52
 
58
53
import tempfile
 
54
import thread
59
55
""")
60
56
 
61
57
 
163
159
 
164
160
        Must return a SmartServerResponse.
165
161
        """
166
 
        if body_bytes != b'':
 
162
        if body_bytes != '':
167
163
            raise errors.SmartProtocolError('Request does not expect a body')
168
164
 
169
165
    def do_chunk(self, chunk_bytes):
175
171
 
176
172
    def do_end(self):
177
173
        """Called when the end of the request has been received."""
178
 
        body_bytes = b''.join(self._body_chunks)
 
174
        body_bytes = ''.join(self._body_chunks)
179
175
        self._body_chunks = None
180
176
        return self.do_body(body_bytes)
181
177
 
196
192
            (unlike the untranslated client_path, which must not be used with
197
193
            the backing transport).
198
194
        """
199
 
        client_path = client_path.decode('utf-8')
200
195
        if self._root_client_path is None:
201
196
            # no translation necessary!
202
197
            return client_path
249
244
    def __eq__(self, other):
250
245
        if other is None:
251
246
            return False
252
 
        return (other.args == self.args
253
 
                and other.body == self.body
254
 
                and other.body_stream is self.body_stream)
 
247
        return (other.args == self.args and
 
248
                other.body == self.body and
 
249
                other.body_stream is self.body_stream)
255
250
 
256
251
    def __repr__(self):
257
252
        return "<%s args=%r body=%r>" % (self.__class__.__name__,
258
 
                                         self.args, self.body)
 
253
            self.args, self.body)
259
254
 
260
255
 
261
256
class FailedSmartServerResponse(SmartServerResponse):
292
287
    # and allow it to be streamed into the server.
293
288
 
294
289
    def __init__(self, backing_transport, commands, root_client_path,
295
 
                 jail_root=None):
 
290
        jail_root=None):
296
291
        """Constructor.
297
292
 
298
293
        :param backing_transport: a Transport to handle requests for.
309
304
        self.finished_reading = False
310
305
        self._command = None
311
306
        if 'hpss' in debug.debug_flags:
312
 
            self._request_start_time = osutils.perf_counter()
313
 
            self._thread_id = get_ident()
 
307
            self._request_start_time = osutils.timer_func()
 
308
            self._thread_id = thread.get_ident()
314
309
 
315
310
    def _trace(self, action, message, extra_bytes=None, include_time=False):
316
 
        # It is a bit of a shame that this functionality overlaps with that of
 
311
        # It is a bit of a shame that this functionality overlaps with that of 
317
312
        # ProtocolThreeRequester._trace. However, there is enough difference
318
313
        # that just putting it in a helper doesn't help a lot. And some state
319
314
        # is taken from the instance.
320
315
        if include_time:
321
 
            t = '%5.3fs ' % (osutils.perf_counter() - self._request_start_time)
 
316
            t = '%5.3fs ' % (osutils.timer_func() - self._request_start_time)
322
317
        else:
323
318
            t = ''
324
319
        if extra_bytes is None:
391
386
            command = self._commands.get(cmd)
392
387
        except LookupError:
393
388
            if 'hpss' in debug.debug_flags:
394
 
                self._trace('hpss unknown request',
 
389
                self._trace('hpss unknown request', 
395
390
                            cmd, repr(args)[1:-1])
396
391
            raise errors.UnknownSmartMethod(cmd)
397
392
        if 'hpss' in debug.debug_flags:
400
395
                action = 'hpss vfs req'
401
396
            else:
402
397
                action = 'hpss request'
403
 
            self._trace(action, '%s %s' % (cmd, repr(args)[1:-1]))
 
398
            self._trace(action, 
 
399
                        '%s %s' % (cmd, repr(args)[1:-1]))
404
400
        self._command = command(
405
401
            self._backing_transport, self._root_client_path, self._jail_root)
406
402
        self._run_handler_code(self._command.execute, args, {})
420
416
 
421
417
def _translate_error(err):
422
418
    if isinstance(err, errors.NoSuchFile):
423
 
        return (b'NoSuchFile', err.path.encode('utf-8'))
 
419
        return ('NoSuchFile', err.path)
424
420
    elif isinstance(err, errors.FileExists):
425
 
        return (b'FileExists', err.path.encode('utf-8'))
 
421
        return ('FileExists', err.path)
426
422
    elif isinstance(err, errors.DirectoryNotEmpty):
427
 
        return (b'DirectoryNotEmpty', err.path.encode('utf-8'))
 
423
        return ('DirectoryNotEmpty', err.path)
428
424
    elif isinstance(err, errors.IncompatibleRepositories):
429
 
        return (b'IncompatibleRepositories', str(err.source), str(err.target),
430
 
                str(err.details))
 
425
        return ('IncompatibleRepositories', str(err.source), str(err.target),
 
426
            str(err.details))
431
427
    elif isinstance(err, errors.ShortReadvError):
432
 
        return (b'ShortReadvError', err.path.encode('utf-8'),
433
 
                str(err.offset).encode('ascii'),
434
 
                str(err.length).encode('ascii'),
435
 
                str(err.actual).encode('ascii'))
 
428
        return ('ShortReadvError', err.path, str(err.offset), str(err.length),
 
429
                str(err.actual))
436
430
    elif isinstance(err, errors.RevisionNotPresent):
437
 
        return (b'RevisionNotPresent', err.revision_id, err.file_id)
 
431
        return ('RevisionNotPresent', err.revision_id, err.file_id)
438
432
    elif isinstance(err, errors.UnstackableRepositoryFormat):
439
 
        return ((b'UnstackableRepositoryFormat',
440
 
                 str(err.format).encode('utf-8'), err.url.encode('utf-8')))
 
433
        return (('UnstackableRepositoryFormat', str(err.format), err.url))
441
434
    elif isinstance(err, _mod_branch.UnstackableBranchFormat):
442
 
        return (b'UnstackableBranchFormat', str(err.format).encode('utf-8'),
443
 
                err.url.encode('utf-8'))
 
435
        return ('UnstackableBranchFormat', str(err.format), err.url)
444
436
    elif isinstance(err, errors.NotStacked):
445
 
        return (b'NotStacked',)
 
437
        return ('NotStacked',)
446
438
    elif isinstance(err, errors.BzrCheckError):
447
 
        return (b'BzrCheckError', err.msg.encode('utf-8'))
 
439
        return ('BzrCheckError', err.msg)
448
440
    elif isinstance(err, UnicodeError):
449
441
        # If it is a DecodeError, than most likely we are starting
450
442
        # with a plain string
451
443
        str_or_unicode = err.object
452
 
        if isinstance(str_or_unicode, text_type):
 
444
        if isinstance(str_or_unicode, unicode):
453
445
            # XXX: UTF-8 might have \x01 (our protocol v1 and v2 seperator
454
446
            # byte) in it, so this encoding could cause broken responses.
455
447
            # Newer clients use protocol v3, so will be fine.
461
453
                str(err.end), err.reason)
462
454
    elif isinstance(err, errors.TransportNotPossible):
463
455
        if err.msg == "readonly transport":
464
 
            return (b'ReadOnlyError', )
 
456
            return ('ReadOnlyError', )
465
457
    elif isinstance(err, errors.ReadError):
466
458
        # cannot read the file
467
 
        return (b'ReadError', err.path)
 
459
        return ('ReadError', err.path)
468
460
    elif isinstance(err, errors.PermissionDenied):
469
 
        return (b'PermissionDenied', err.path.encode('utf-8'), err.extra.encode('utf-8'))
 
461
        return ('PermissionDenied', err.path, err.extra)
470
462
    elif isinstance(err, errors.TokenMismatch):
471
 
        return (b'TokenMismatch', err.given_token, err.lock_token)
 
463
        return ('TokenMismatch', err.given_token, err.lock_token)
472
464
    elif isinstance(err, errors.LockContention):
473
 
        return (b'LockContention',)
474
 
    elif isinstance(err, errors.GhostRevisionsHaveNoRevno):
475
 
        return (b'GhostRevisionsHaveNoRevno', err.revision_id, err.ghost_revision_id)
476
 
    elif isinstance(err, urlutils.InvalidURL):
477
 
        return (b'InvalidURL', err.path.encode('utf-8'), err.extra.encode('ascii'))
 
465
        return ('LockContention',)
478
466
    elif isinstance(err, MemoryError):
479
467
        # GZ 2011-02-24: Copy breezy.trace -Dmem_dump functionality here?
480
 
        return (b'MemoryError',)
 
468
        return ('MemoryError',)
481
469
    # Unserialisable error.  Log it, and return a generic error
482
470
    trace.log_exception_quietly()
483
 
    return (b'error',
484
 
            trace._qualified_exception_name(
485
 
                err.__class__, True).encode('utf-8'),
486
 
            str(err).encode('utf-8'))
 
471
    return ('error', trace._qualified_exception_name(err.__class__, True),
 
472
        str(err))
487
473
 
488
474
 
489
475
class HelloRequest(SmartServerRequest):
492
478
    """
493
479
 
494
480
    def do(self):
495
 
        return SuccessfulSmartServerResponse((b'ok', b'2'))
 
481
        return SuccessfulSmartServerResponse(('ok', '2'))
496
482
 
497
483
 
498
484
class GetBundleRequest(SmartServerRequest):
515
501
 
516
502
    def do(self):
517
503
        if self._backing_transport.is_readonly():
518
 
            answer = b'yes'
 
504
            answer = 'yes'
519
505
        else:
520
 
            answer = b'no'
 
506
            answer = 'no'
521
507
        return SuccessfulSmartServerResponse((answer,))
522
508
 
523
509
 
547
533
#           file. If append succeeds, it moves the file pointer.
548
534
request_handlers = registry.Registry()
549
535
request_handlers.register_lazy(
550
 
    b'append', 'breezy.bzr.smart.vfs', 'AppendRequest', info='mutate')
 
536
    'append', 'breezy.bzr.smart.vfs', 'AppendRequest', info='mutate')
551
537
request_handlers.register_lazy(
552
 
    b'Branch.break_lock', 'breezy.bzr.smart.branch',
 
538
    'Branch.break_lock', 'breezy.bzr.smart.branch',
553
539
    'SmartServerBranchBreakLock', info='idem')
554
540
request_handlers.register_lazy(
555
 
    b'Branch.get_config_file', 'breezy.bzr.smart.branch',
 
541
    'Branch.get_config_file', 'breezy.bzr.smart.branch',
556
542
    'SmartServerBranchGetConfigFile', info='read')
557
543
request_handlers.register_lazy(
558
 
    b'Branch.get_parent', 'breezy.bzr.smart.branch', 'SmartServerBranchGetParent',
 
544
    'Branch.get_parent', 'breezy.bzr.smart.branch', 'SmartServerBranchGetParent',
559
545
    info='read')
560
546
request_handlers.register_lazy(
561
 
    b'Branch.put_config_file', 'breezy.bzr.smart.branch',
 
547
    'Branch.put_config_file', 'breezy.bzr.smart.branch',
562
548
    'SmartServerBranchPutConfigFile', info='idem')
563
549
request_handlers.register_lazy(
564
 
    b'Branch.get_tags_bytes', 'breezy.bzr.smart.branch',
 
550
    'Branch.get_tags_bytes', 'breezy.bzr.smart.branch',
565
551
    'SmartServerBranchGetTagsBytes', info='read')
566
552
request_handlers.register_lazy(
567
 
    b'Branch.set_tags_bytes', 'breezy.bzr.smart.branch',
 
553
    'Branch.set_tags_bytes', 'breezy.bzr.smart.branch',
568
554
    'SmartServerBranchSetTagsBytes', info='idem')
569
555
request_handlers.register_lazy(
570
 
    b'Branch.heads_to_fetch', 'breezy.bzr.smart.branch',
 
556
    'Branch.heads_to_fetch', 'breezy.bzr.smart.branch',
571
557
    'SmartServerBranchHeadsToFetch', info='read')
572
558
request_handlers.register_lazy(
573
 
    b'Branch.get_stacked_on_url', 'breezy.bzr.smart.branch',
 
559
    'Branch.get_stacked_on_url', 'breezy.bzr.smart.branch',
574
560
    'SmartServerBranchRequestGetStackedOnURL', info='read')
575
561
request_handlers.register_lazy(
576
 
    b'Branch.get_physical_lock_status', 'breezy.bzr.smart.branch',
 
562
    'Branch.get_physical_lock_status', 'breezy.bzr.smart.branch',
577
563
    'SmartServerBranchRequestGetPhysicalLockStatus', info='read')
578
564
request_handlers.register_lazy(
579
 
    b'Branch.last_revision_info', 'breezy.bzr.smart.branch',
 
565
    'Branch.last_revision_info', 'breezy.bzr.smart.branch',
580
566
    'SmartServerBranchRequestLastRevisionInfo', info='read')
581
567
request_handlers.register_lazy(
582
 
    b'Branch.lock_write', 'breezy.bzr.smart.branch',
 
568
    'Branch.lock_write', 'breezy.bzr.smart.branch',
583
569
    'SmartServerBranchRequestLockWrite', info='semi')
584
570
request_handlers.register_lazy(
585
 
    b'Branch.revision_history', 'breezy.bzr.smart.branch',
 
571
    'Branch.revision_history', 'breezy.bzr.smart.branch',
586
572
    'SmartServerRequestRevisionHistory', info='read')
587
573
request_handlers.register_lazy(
588
 
    b'Branch.set_config_option', 'breezy.bzr.smart.branch',
 
574
    'Branch.set_config_option', 'breezy.bzr.smart.branch',
589
575
    'SmartServerBranchRequestSetConfigOption', info='idem')
590
576
request_handlers.register_lazy(
591
 
    b'Branch.set_config_option_dict', 'breezy.bzr.smart.branch',
 
577
    'Branch.set_config_option_dict', 'breezy.bzr.smart.branch',
592
578
    'SmartServerBranchRequestSetConfigOptionDict', info='idem')
593
579
request_handlers.register_lazy(
594
 
    b'Branch.set_last_revision', 'breezy.bzr.smart.branch',
 
580
    'Branch.set_last_revision', 'breezy.bzr.smart.branch',
595
581
    'SmartServerBranchRequestSetLastRevision', info='idem')
596
582
request_handlers.register_lazy(
597
 
    b'Branch.set_last_revision_info', 'breezy.bzr.smart.branch',
 
583
    'Branch.set_last_revision_info', 'breezy.bzr.smart.branch',
598
584
    'SmartServerBranchRequestSetLastRevisionInfo', info='idem')
599
585
request_handlers.register_lazy(
600
 
    b'Branch.set_last_revision_ex', 'breezy.bzr.smart.branch',
 
586
    'Branch.set_last_revision_ex', 'breezy.bzr.smart.branch',
601
587
    'SmartServerBranchRequestSetLastRevisionEx', info='idem')
602
588
request_handlers.register_lazy(
603
 
    b'Branch.set_parent_location', 'breezy.bzr.smart.branch',
 
589
    'Branch.set_parent_location', 'breezy.bzr.smart.branch',
604
590
    'SmartServerBranchRequestSetParentLocation', info='idem')
605
591
request_handlers.register_lazy(
606
 
    b'Branch.unlock', 'breezy.bzr.smart.branch',
 
592
    'Branch.unlock', 'breezy.bzr.smart.branch',
607
593
    'SmartServerBranchRequestUnlock', info='semi')
608
594
request_handlers.register_lazy(
609
 
    b'Branch.revision_id_to_revno', 'breezy.bzr.smart.branch',
 
595
    'Branch.revision_id_to_revno', 'breezy.bzr.smart.branch',
610
596
    'SmartServerBranchRequestRevisionIdToRevno', info='read')
611
597
request_handlers.register_lazy(
612
 
    b'Branch.get_all_reference_info', 'breezy.bzr.smart.branch',
613
 
    'SmartServerBranchRequestGetAllReferenceInfo', info='read')
614
 
request_handlers.register_lazy(
615
 
    b'BzrDir.checkout_metadir', 'breezy.bzr.smart.bzrdir',
 
598
    'BzrDir.checkout_metadir', 'breezy.bzr.smart.bzrdir',
616
599
    'SmartServerBzrDirRequestCheckoutMetaDir', info='read')
617
600
request_handlers.register_lazy(
618
 
    b'BzrDir.cloning_metadir', 'breezy.bzr.smart.bzrdir',
 
601
    'BzrDir.cloning_metadir', 'breezy.bzr.smart.bzrdir',
619
602
    'SmartServerBzrDirRequestCloningMetaDir', info='read')
620
603
request_handlers.register_lazy(
621
 
    b'BzrDir.create_branch', 'breezy.bzr.smart.bzrdir',
 
604
    'BzrDir.create_branch', 'breezy.bzr.smart.bzrdir',
622
605
    'SmartServerRequestCreateBranch', info='semi')
623
606
request_handlers.register_lazy(
624
 
    b'BzrDir.create_repository', 'breezy.bzr.smart.bzrdir',
 
607
    'BzrDir.create_repository', 'breezy.bzr.smart.bzrdir',
625
608
    'SmartServerRequestCreateRepository', info='semi')
626
609
request_handlers.register_lazy(
627
 
    b'BzrDir.find_repository', 'breezy.bzr.smart.bzrdir',
 
610
    'BzrDir.find_repository', 'breezy.bzr.smart.bzrdir',
628
611
    'SmartServerRequestFindRepositoryV1', info='read')
629
612
request_handlers.register_lazy(
630
 
    b'BzrDir.find_repositoryV2', 'breezy.bzr.smart.bzrdir',
 
613
    'BzrDir.find_repositoryV2', 'breezy.bzr.smart.bzrdir',
631
614
    'SmartServerRequestFindRepositoryV2', info='read')
632
615
request_handlers.register_lazy(
633
 
    b'BzrDir.find_repositoryV3', 'breezy.bzr.smart.bzrdir',
 
616
    'BzrDir.find_repositoryV3', 'breezy.bzr.smart.bzrdir',
634
617
    'SmartServerRequestFindRepositoryV3', info='read')
635
618
request_handlers.register_lazy(
636
 
    b'BzrDir.get_branches', 'breezy.bzr.smart.bzrdir',
 
619
    'BzrDir.get_branches', 'breezy.bzr.smart.bzrdir',
637
620
    'SmartServerBzrDirRequestGetBranches', info='read')
638
621
request_handlers.register_lazy(
639
 
    b'BzrDir.get_config_file', 'breezy.bzr.smart.bzrdir',
 
622
    'BzrDir.get_config_file', 'breezy.bzr.smart.bzrdir',
640
623
    'SmartServerBzrDirRequestConfigFile', info='read')
641
624
request_handlers.register_lazy(
642
 
    b'BzrDir.destroy_branch', 'breezy.bzr.smart.bzrdir',
 
625
    'BzrDir.destroy_branch', 'breezy.bzr.smart.bzrdir',
643
626
    'SmartServerBzrDirRequestDestroyBranch', info='semi')
644
627
request_handlers.register_lazy(
645
 
    b'BzrDir.destroy_repository', 'breezy.bzr.smart.bzrdir',
 
628
    'BzrDir.destroy_repository', 'breezy.bzr.smart.bzrdir',
646
629
    'SmartServerBzrDirRequestDestroyRepository', info='semi')
647
630
request_handlers.register_lazy(
648
 
    b'BzrDir.has_workingtree', 'breezy.bzr.smart.bzrdir',
 
631
    'BzrDir.has_workingtree', 'breezy.bzr.smart.bzrdir',
649
632
    'SmartServerBzrDirRequestHasWorkingTree', info='read')
650
633
request_handlers.register_lazy(
651
 
    b'BzrDirFormat.initialize', 'breezy.bzr.smart.bzrdir',
 
634
    'BzrDirFormat.initialize', 'breezy.bzr.smart.bzrdir',
652
635
    'SmartServerRequestInitializeBzrDir', info='semi')
653
636
request_handlers.register_lazy(
654
 
    b'BzrDirFormat.initialize_ex_1.16', 'breezy.bzr.smart.bzrdir',
 
637
    'BzrDirFormat.initialize_ex_1.16', 'breezy.bzr.smart.bzrdir',
655
638
    'SmartServerRequestBzrDirInitializeEx', info='semi')
656
639
request_handlers.register_lazy(
657
 
    b'BzrDir.open', 'breezy.bzr.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
 
640
    'BzrDir.open', 'breezy.bzr.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
658
641
    info='read')
659
642
request_handlers.register_lazy(
660
 
    b'BzrDir.open_2.1', 'breezy.bzr.smart.bzrdir',
 
643
    'BzrDir.open_2.1', 'breezy.bzr.smart.bzrdir',
661
644
    'SmartServerRequestOpenBzrDir_2_1', info='read')
662
645
request_handlers.register_lazy(
663
 
    b'BzrDir.open_branch', 'breezy.bzr.smart.bzrdir',
 
646
    'BzrDir.open_branch', 'breezy.bzr.smart.bzrdir',
664
647
    'SmartServerRequestOpenBranch', info='read')
665
648
request_handlers.register_lazy(
666
 
    b'BzrDir.open_branchV2', 'breezy.bzr.smart.bzrdir',
 
649
    'BzrDir.open_branchV2', 'breezy.bzr.smart.bzrdir',
667
650
    'SmartServerRequestOpenBranchV2', info='read')
668
651
request_handlers.register_lazy(
669
 
    b'BzrDir.open_branchV3', 'breezy.bzr.smart.bzrdir',
 
652
    'BzrDir.open_branchV3', 'breezy.bzr.smart.bzrdir',
670
653
    'SmartServerRequestOpenBranchV3', info='read')
671
654
request_handlers.register_lazy(
672
 
    b'delete', 'breezy.bzr.smart.vfs', 'DeleteRequest', info='semivfs')
673
 
request_handlers.register_lazy(
674
 
    b'get', 'breezy.bzr.smart.vfs', 'GetRequest', info='read')
675
 
request_handlers.register_lazy(
676
 
    b'get_bundle', 'breezy.bzr.smart.request', 'GetBundleRequest', info='read')
677
 
request_handlers.register_lazy(
678
 
    b'has', 'breezy.bzr.smart.vfs', 'HasRequest', info='read')
679
 
request_handlers.register_lazy(
680
 
    b'hello', 'breezy.bzr.smart.request', 'HelloRequest', info='read')
681
 
request_handlers.register_lazy(
682
 
    b'iter_files_recursive', 'breezy.bzr.smart.vfs', 'IterFilesRecursiveRequest',
 
655
    'delete', 'breezy.bzr.smart.vfs', 'DeleteRequest', info='semivfs')
 
656
request_handlers.register_lazy(
 
657
    'get', 'breezy.bzr.smart.vfs', 'GetRequest', info='read')
 
658
request_handlers.register_lazy(
 
659
    'get_bundle', 'breezy.bzr.smart.request', 'GetBundleRequest', info='read')
 
660
request_handlers.register_lazy(
 
661
    'has', 'breezy.bzr.smart.vfs', 'HasRequest', info='read')
 
662
request_handlers.register_lazy(
 
663
    'hello', 'breezy.bzr.smart.request', 'HelloRequest', info='read')
 
664
request_handlers.register_lazy(
 
665
    'iter_files_recursive', 'breezy.bzr.smart.vfs', 'IterFilesRecursiveRequest',
683
666
    info='read')
684
667
request_handlers.register_lazy(
685
 
    b'list_dir', 'breezy.bzr.smart.vfs', 'ListDirRequest', info='read')
686
 
request_handlers.register_lazy(
687
 
    b'mkdir', 'breezy.bzr.smart.vfs', 'MkdirRequest', info='semivfs')
688
 
request_handlers.register_lazy(
689
 
    b'move', 'breezy.bzr.smart.vfs', 'MoveRequest', info='semivfs')
690
 
request_handlers.register_lazy(
691
 
    b'put', 'breezy.bzr.smart.vfs', 'PutRequest', info='idem')
692
 
request_handlers.register_lazy(
693
 
    b'put_non_atomic', 'breezy.bzr.smart.vfs', 'PutNonAtomicRequest', info='idem')
694
 
request_handlers.register_lazy(
695
 
    b'readv', 'breezy.bzr.smart.vfs', 'ReadvRequest', info='read')
696
 
request_handlers.register_lazy(
697
 
    b'rename', 'breezy.bzr.smart.vfs', 'RenameRequest', info='semivfs')
698
 
request_handlers.register_lazy(
699
 
    b'Repository.add_signature_text', 'breezy.bzr.smart.repository',
 
668
    'list_dir', 'breezy.bzr.smart.vfs', 'ListDirRequest', info='read')
 
669
request_handlers.register_lazy(
 
670
    'mkdir', 'breezy.bzr.smart.vfs', 'MkdirRequest', info='semivfs')
 
671
request_handlers.register_lazy(
 
672
    'move', 'breezy.bzr.smart.vfs', 'MoveRequest', info='semivfs')
 
673
request_handlers.register_lazy(
 
674
    'put', 'breezy.bzr.smart.vfs', 'PutRequest', info='idem')
 
675
request_handlers.register_lazy(
 
676
    'put_non_atomic', 'breezy.bzr.smart.vfs', 'PutNonAtomicRequest', info='idem')
 
677
request_handlers.register_lazy(
 
678
    'readv', 'breezy.bzr.smart.vfs', 'ReadvRequest', info='read')
 
679
request_handlers.register_lazy(
 
680
    'rename', 'breezy.bzr.smart.vfs', 'RenameRequest', info='semivfs')
 
681
request_handlers.register_lazy(
 
682
    'Repository.add_signature_text', 'breezy.bzr.smart.repository',
700
683
    'SmartServerRepositoryAddSignatureText', info='idem')
701
684
request_handlers.register_lazy(
702
 
    b'Repository.annotate_file_revision', 'breezy.bzr.smart.repository',
703
 
    'SmartServerRepositoryAnnotateFileRevision', info='read')
704
 
request_handlers.register_lazy(
705
 
    b'Repository.all_revision_ids', 'breezy.bzr.smart.repository',
 
685
    'Repository.all_revision_ids', 'breezy.bzr.smart.repository',
706
686
    'SmartServerRepositoryAllRevisionIds', info='read')
707
687
request_handlers.register_lazy(
708
 
    b'PackRepository.autopack', 'breezy.bzr.smart.packrepository',
 
688
    'PackRepository.autopack', 'breezy.bzr.smart.packrepository',
709
689
    'SmartServerPackRepositoryAutopack', info='idem')
710
690
request_handlers.register_lazy(
711
 
    b'Repository.break_lock', 'breezy.bzr.smart.repository',
 
691
    'Repository.break_lock', 'breezy.bzr.smart.repository',
712
692
    'SmartServerRepositoryBreakLock', info='idem')
713
693
request_handlers.register_lazy(
714
 
    b'Repository.gather_stats', 'breezy.bzr.smart.repository',
 
694
    'Repository.gather_stats', 'breezy.bzr.smart.repository',
715
695
    'SmartServerRepositoryGatherStats', info='read')
716
696
request_handlers.register_lazy(
717
 
    b'Repository.get_parent_map', 'breezy.bzr.smart.repository',
 
697
    'Repository.get_parent_map', 'breezy.bzr.smart.repository',
718
698
    'SmartServerRepositoryGetParentMap', info='read')
719
699
request_handlers.register_lazy(
720
 
    b'Repository.get_revision_graph', 'breezy.bzr.smart.repository',
 
700
    'Repository.get_revision_graph', 'breezy.bzr.smart.repository',
721
701
    'SmartServerRepositoryGetRevisionGraph', info='read')
722
702
request_handlers.register_lazy(
723
 
    b'Repository.get_revision_signature_text', 'breezy.bzr.smart.repository',
 
703
    'Repository.get_revision_signature_text', 'breezy.bzr.smart.repository',
724
704
    'SmartServerRepositoryGetRevisionSignatureText', info='read')
725
705
request_handlers.register_lazy(
726
 
    b'Repository.has_revision', 'breezy.bzr.smart.repository',
 
706
    'Repository.has_revision', 'breezy.bzr.smart.repository',
727
707
    'SmartServerRequestHasRevision', info='read')
728
708
request_handlers.register_lazy(
729
 
    b'Repository.has_signature_for_revision_id', 'breezy.bzr.smart.repository',
 
709
    'Repository.has_signature_for_revision_id', 'breezy.bzr.smart.repository',
730
710
    'SmartServerRequestHasSignatureForRevisionId', info='read')
731
711
request_handlers.register_lazy(
732
 
    b'Repository.insert_stream', 'breezy.bzr.smart.repository',
 
712
    'Repository.insert_stream', 'breezy.bzr.smart.repository',
733
713
    'SmartServerRepositoryInsertStream', info='stream')
734
714
request_handlers.register_lazy(
735
 
    b'Repository.insert_stream_1.19', 'breezy.bzr.smart.repository',
 
715
    'Repository.insert_stream_1.19', 'breezy.bzr.smart.repository',
736
716
    'SmartServerRepositoryInsertStream_1_19', info='stream')
737
717
request_handlers.register_lazy(
738
 
    b'Repository.insert_stream_locked', 'breezy.bzr.smart.repository',
 
718
    'Repository.insert_stream_locked', 'breezy.bzr.smart.repository',
739
719
    'SmartServerRepositoryInsertStreamLocked', info='stream')
740
720
request_handlers.register_lazy(
741
 
    b'Repository.is_shared', 'breezy.bzr.smart.repository',
 
721
    'Repository.is_shared', 'breezy.bzr.smart.repository',
742
722
    'SmartServerRepositoryIsShared', info='read')
743
723
request_handlers.register_lazy(
744
 
    b'Repository.iter_files_bytes', 'breezy.bzr.smart.repository',
 
724
    'Repository.iter_files_bytes', 'breezy.bzr.smart.repository',
745
725
    'SmartServerRepositoryIterFilesBytes', info='read')
746
726
request_handlers.register_lazy(
747
 
    b'Repository.lock_write', 'breezy.bzr.smart.repository',
 
727
    'Repository.lock_write', 'breezy.bzr.smart.repository',
748
728
    'SmartServerRepositoryLockWrite', info='semi')
749
729
request_handlers.register_lazy(
750
 
    b'Repository.make_working_trees', 'breezy.bzr.smart.repository',
 
730
    'Repository.make_working_trees', 'breezy.bzr.smart.repository',
751
731
    'SmartServerRepositoryMakeWorkingTrees', info='read')
752
732
request_handlers.register_lazy(
753
 
    b'Repository.set_make_working_trees', 'breezy.bzr.smart.repository',
 
733
    'Repository.set_make_working_trees', 'breezy.bzr.smart.repository',
754
734
    'SmartServerRepositorySetMakeWorkingTrees', info='idem')
755
735
request_handlers.register_lazy(
756
 
    b'Repository.unlock', 'breezy.bzr.smart.repository',
 
736
    'Repository.unlock', 'breezy.bzr.smart.repository',
757
737
    'SmartServerRepositoryUnlock', info='semi')
758
738
request_handlers.register_lazy(
759
 
    b'Repository.get_physical_lock_status', 'breezy.bzr.smart.repository',
 
739
    'Repository.get_physical_lock_status', 'breezy.bzr.smart.repository',
760
740
    'SmartServerRepositoryGetPhysicalLockStatus', info='read')
761
741
request_handlers.register_lazy(
762
 
    b'Repository.get_rev_id_for_revno', 'breezy.bzr.smart.repository',
 
742
    'Repository.get_rev_id_for_revno', 'breezy.bzr.smart.repository',
763
743
    'SmartServerRepositoryGetRevIdForRevno', info='read')
764
744
request_handlers.register_lazy(
765
 
    b'Repository.get_stream', 'breezy.bzr.smart.repository',
 
745
    'Repository.get_stream', 'breezy.bzr.smart.repository',
766
746
    'SmartServerRepositoryGetStream', info='read')
767
747
request_handlers.register_lazy(
768
 
    b'Repository.get_stream_1.19', 'breezy.bzr.smart.repository',
 
748
    'Repository.get_stream_1.19', 'breezy.bzr.smart.repository',
769
749
    'SmartServerRepositoryGetStream_1_19', info='read')
770
750
request_handlers.register_lazy(
771
 
    b'Repository.get_stream_for_missing_keys', 'breezy.bzr.smart.repository',
772
 
    'SmartServerRepositoryGetStreamForMissingKeys', info='read')
773
 
request_handlers.register_lazy(
774
 
    b'Repository.iter_revisions', 'breezy.bzr.smart.repository',
 
751
    'Repository.iter_revisions', 'breezy.bzr.smart.repository',
775
752
    'SmartServerRepositoryIterRevisions', info='read')
776
753
request_handlers.register_lazy(
777
 
    b'Repository.pack', 'breezy.bzr.smart.repository',
 
754
    'Repository.pack', 'breezy.bzr.smart.repository',
778
755
    'SmartServerRepositoryPack', info='idem')
779
756
request_handlers.register_lazy(
780
 
    b'Repository.start_write_group', 'breezy.bzr.smart.repository',
 
757
    'Repository.start_write_group', 'breezy.bzr.smart.repository',
781
758
    'SmartServerRepositoryStartWriteGroup', info='semi')
782
759
request_handlers.register_lazy(
783
 
    b'Repository.commit_write_group', 'breezy.bzr.smart.repository',
 
760
    'Repository.commit_write_group', 'breezy.bzr.smart.repository',
784
761
    'SmartServerRepositoryCommitWriteGroup', info='semi')
785
762
request_handlers.register_lazy(
786
 
    b'Repository.abort_write_group', 'breezy.bzr.smart.repository',
 
763
    'Repository.abort_write_group', 'breezy.bzr.smart.repository',
787
764
    'SmartServerRepositoryAbortWriteGroup', info='semi')
788
765
request_handlers.register_lazy(
789
 
    b'Repository.check_write_group', 'breezy.bzr.smart.repository',
 
766
    'Repository.check_write_group', 'breezy.bzr.smart.repository',
790
767
    'SmartServerRepositoryCheckWriteGroup', info='read')
791
768
request_handlers.register_lazy(
792
 
    b'Repository.reconcile', 'breezy.bzr.smart.repository',
 
769
    'Repository.reconcile', 'breezy.bzr.smart.repository',
793
770
    'SmartServerRepositoryReconcile', info='idem')
794
771
request_handlers.register_lazy(
795
 
    b'Repository.revision_archive', 'breezy.bzr.smart.repository',
796
 
    'SmartServerRepositoryRevisionArchive', info='read')
797
 
request_handlers.register_lazy(
798
 
    b'Repository.tarball', 'breezy.bzr.smart.repository',
 
772
    'Repository.tarball', 'breezy.bzr.smart.repository',
799
773
    'SmartServerRepositoryTarball', info='read')
800
774
request_handlers.register_lazy(
801
 
    b'VersionedFileRepository.get_serializer_format', 'breezy.bzr.smart.repository',
 
775
    'VersionedFileRepository.get_serializer_format', 'breezy.bzr.smart.repository',
802
776
    'SmartServerRepositoryGetSerializerFormat', info='read')
803
777
request_handlers.register_lazy(
804
 
    b'VersionedFileRepository.get_inventories', 'breezy.bzr.smart.repository',
 
778
    'VersionedFileRepository.get_inventories', 'breezy.bzr.smart.repository',
805
779
    'SmartServerRepositoryGetInventories', info='read')
806
780
request_handlers.register_lazy(
807
 
    b'rmdir', 'breezy.bzr.smart.vfs', 'RmdirRequest', info='semivfs')
808
 
request_handlers.register_lazy(
809
 
    b'stat', 'breezy.bzr.smart.vfs', 'StatRequest', info='read')
810
 
request_handlers.register_lazy(
811
 
    b'Transport.is_readonly', 'breezy.bzr.smart.request',
 
781
    'rmdir', 'breezy.bzr.smart.vfs', 'RmdirRequest', info='semivfs')
 
782
request_handlers.register_lazy(
 
783
    'stat', 'breezy.bzr.smart.vfs', 'StatRequest', info='read')
 
784
request_handlers.register_lazy(
 
785
    'Transport.is_readonly', 'breezy.bzr.smart.request',
812
786
    'SmartServerIsReadonly', info='read')