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

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

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