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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

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 brzlib 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 brzlib.lazy_import import lazy_import
48
48
lazy_import(globals(), """
49
 
from breezy.bzr import bzrdir
50
 
from breezy.bzr.bundle import serializer
 
49
from brzlib import bzrdir
 
50
from brzlib.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.
293
284
        :param commands: a registry mapping command names to SmartServerRequest
294
 
            subclasses. e.g. breezy.transport.smart.vfs.vfs_commands.
 
285
            subclasses. e.g. brzlib.transport.smart.vfs.vfs_commands.
295
286
        """
296
287
        self._backing_transport = backing_transport
297
288
        self._root_client_path = root_client_path
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:
369
360
                self._command.teardown_jail()
370
361
        except (KeyboardInterrupt, SystemExit):
371
362
            raise
372
 
        except Exception as err:
 
363
        except Exception, err:
373
364
            err_struct = _translate_error(err)
374
365
            return FailedSmartServerResponse(err_struct)
375
366
 
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:
392
 
            from . import vfs
 
383
            from brzlib.smart import vfs
393
384
            if issubclass(command, vfs.VfsRequest):
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
 
        # GZ 2011-02-24: Copy breezy.trace -Dmem_dump functionality here?
474
 
        return (b'MemoryError',)
 
457
        # GZ 2011-02-24: Copy brzlib.trace -Dmem_dump functionality here?
 
458
        return ('MemoryError',)
475
459
    # Unserialisable error.  Log it, and return a generic error
476
460
    trace.log_exception_quietly()
477
 
    return (b'error',
478
 
            trace._qualified_exception_name(
479
 
                err.__class__, True).encode('utf-8'),
480
 
            str(err).encode('utf-8'))
 
461
    return ('error', trace._qualified_exception_name(err.__class__, True),
 
462
        str(err))
481
463
 
482
464
 
483
465
class HelloRequest(SmartServerRequest):
486
468
    """
487
469
 
488
470
    def do(self):
489
 
        return SuccessfulSmartServerResponse((b'ok', b'2'))
 
471
        return SuccessfulSmartServerResponse(('ok', '2'))
490
472
 
491
473
 
492
474
class GetBundleRequest(SmartServerRequest):
509
491
 
510
492
    def do(self):
511
493
        if self._backing_transport.is_readonly():
512
 
            answer = b'yes'
 
494
            answer = 'yes'
513
495
        else:
514
 
            answer = b'no'
 
496
            answer = 'no'
515
497
        return SuccessfulSmartServerResponse((answer,))
516
498
 
517
499
 
541
523
#           file. If append succeeds, it moves the file pointer.
542
524
request_handlers = registry.Registry()
543
525
request_handlers.register_lazy(
544
 
    b'append', 'breezy.bzr.smart.vfs', 'AppendRequest', info='mutate')
 
526
    'append', 'brzlib.smart.vfs', 'AppendRequest', info='mutate')
545
527
request_handlers.register_lazy(
546
 
    b'Branch.break_lock', 'breezy.bzr.smart.branch',
 
528
    'Branch.break_lock', 'brzlib.smart.branch',
547
529
    'SmartServerBranchBreakLock', info='idem')
548
530
request_handlers.register_lazy(
549
 
    b'Branch.get_config_file', 'breezy.bzr.smart.branch',
 
531
    'Branch.get_config_file', 'brzlib.smart.branch',
550
532
    'SmartServerBranchGetConfigFile', info='read')
551
533
request_handlers.register_lazy(
552
 
    b'Branch.get_parent', 'breezy.bzr.smart.branch', 'SmartServerBranchGetParent',
 
534
    'Branch.get_parent', 'brzlib.smart.branch', 'SmartServerBranchGetParent',
553
535
    info='read')
554
536
request_handlers.register_lazy(
555
 
    b'Branch.put_config_file', 'breezy.bzr.smart.branch',
 
537
    'Branch.put_config_file', 'brzlib.smart.branch',
556
538
    'SmartServerBranchPutConfigFile', info='idem')
557
539
request_handlers.register_lazy(
558
 
    b'Branch.get_tags_bytes', 'breezy.bzr.smart.branch',
 
540
    'Branch.get_tags_bytes', 'brzlib.smart.branch',
559
541
    'SmartServerBranchGetTagsBytes', info='read')
560
542
request_handlers.register_lazy(
561
 
    b'Branch.set_tags_bytes', 'breezy.bzr.smart.branch',
 
543
    'Branch.set_tags_bytes', 'brzlib.smart.branch',
562
544
    'SmartServerBranchSetTagsBytes', info='idem')
563
545
request_handlers.register_lazy(
564
 
    b'Branch.heads_to_fetch', 'breezy.bzr.smart.branch',
 
546
    'Branch.heads_to_fetch', 'brzlib.smart.branch',
565
547
    'SmartServerBranchHeadsToFetch', info='read')
566
548
request_handlers.register_lazy(
567
 
    b'Branch.get_stacked_on_url', 'breezy.bzr.smart.branch',
 
549
    'Branch.get_stacked_on_url', 'brzlib.smart.branch',
568
550
    'SmartServerBranchRequestGetStackedOnURL', info='read')
569
551
request_handlers.register_lazy(
570
 
    b'Branch.get_physical_lock_status', 'breezy.bzr.smart.branch',
 
552
    'Branch.get_physical_lock_status', 'brzlib.smart.branch',
571
553
    'SmartServerBranchRequestGetPhysicalLockStatus', info='read')
572
554
request_handlers.register_lazy(
573
 
    b'Branch.last_revision_info', 'breezy.bzr.smart.branch',
 
555
    'Branch.last_revision_info', 'brzlib.smart.branch',
574
556
    'SmartServerBranchRequestLastRevisionInfo', info='read')
575
557
request_handlers.register_lazy(
576
 
    b'Branch.lock_write', 'breezy.bzr.smart.branch',
 
558
    'Branch.lock_write', 'brzlib.smart.branch',
577
559
    'SmartServerBranchRequestLockWrite', info='semi')
578
560
request_handlers.register_lazy(
579
 
    b'Branch.revision_history', 'breezy.bzr.smart.branch',
 
561
    'Branch.revision_history', 'brzlib.smart.branch',
580
562
    'SmartServerRequestRevisionHistory', info='read')
581
563
request_handlers.register_lazy(
582
 
    b'Branch.set_config_option', 'breezy.bzr.smart.branch',
 
564
    'Branch.set_config_option', 'brzlib.smart.branch',
583
565
    'SmartServerBranchRequestSetConfigOption', info='idem')
584
566
request_handlers.register_lazy(
585
 
    b'Branch.set_config_option_dict', 'breezy.bzr.smart.branch',
 
567
    'Branch.set_config_option_dict', 'brzlib.smart.branch',
586
568
    'SmartServerBranchRequestSetConfigOptionDict', info='idem')
587
569
request_handlers.register_lazy(
588
 
    b'Branch.set_last_revision', 'breezy.bzr.smart.branch',
 
570
    'Branch.set_last_revision', 'brzlib.smart.branch',
589
571
    'SmartServerBranchRequestSetLastRevision', info='idem')
590
572
request_handlers.register_lazy(
591
 
    b'Branch.set_last_revision_info', 'breezy.bzr.smart.branch',
 
573
    'Branch.set_last_revision_info', 'brzlib.smart.branch',
592
574
    'SmartServerBranchRequestSetLastRevisionInfo', info='idem')
593
575
request_handlers.register_lazy(
594
 
    b'Branch.set_last_revision_ex', 'breezy.bzr.smart.branch',
 
576
    'Branch.set_last_revision_ex', 'brzlib.smart.branch',
595
577
    'SmartServerBranchRequestSetLastRevisionEx', info='idem')
596
578
request_handlers.register_lazy(
597
 
    b'Branch.set_parent_location', 'breezy.bzr.smart.branch',
 
579
    'Branch.set_parent_location', 'brzlib.smart.branch',
598
580
    'SmartServerBranchRequestSetParentLocation', info='idem')
599
581
request_handlers.register_lazy(
600
 
    b'Branch.unlock', 'breezy.bzr.smart.branch',
 
582
    'Branch.unlock', 'brzlib.smart.branch',
601
583
    'SmartServerBranchRequestUnlock', info='semi')
602
584
request_handlers.register_lazy(
603
 
    b'Branch.revision_id_to_revno', 'breezy.bzr.smart.branch',
 
585
    'Branch.revision_id_to_revno', 'brzlib.smart.branch',
604
586
    'SmartServerBranchRequestRevisionIdToRevno', info='read')
605
587
request_handlers.register_lazy(
606
 
    b'Branch.get_all_reference_info', 'breezy.bzr.smart.branch',
607
 
    'SmartServerBranchRequestGetAllReferenceInfo', info='read')
608
 
request_handlers.register_lazy(
609
 
    b'BzrDir.checkout_metadir', 'breezy.bzr.smart.bzrdir',
 
588
    'BzrDir.checkout_metadir', 'brzlib.smart.bzrdir',
610
589
    'SmartServerBzrDirRequestCheckoutMetaDir', info='read')
611
590
request_handlers.register_lazy(
612
 
    b'BzrDir.cloning_metadir', 'breezy.bzr.smart.bzrdir',
 
591
    'BzrDir.cloning_metadir', 'brzlib.smart.bzrdir',
613
592
    'SmartServerBzrDirRequestCloningMetaDir', info='read')
614
593
request_handlers.register_lazy(
615
 
    b'BzrDir.create_branch', 'breezy.bzr.smart.bzrdir',
 
594
    'BzrDir.create_branch', 'brzlib.smart.bzrdir',
616
595
    'SmartServerRequestCreateBranch', info='semi')
617
596
request_handlers.register_lazy(
618
 
    b'BzrDir.create_repository', 'breezy.bzr.smart.bzrdir',
 
597
    'BzrDir.create_repository', 'brzlib.smart.bzrdir',
619
598
    'SmartServerRequestCreateRepository', info='semi')
620
599
request_handlers.register_lazy(
621
 
    b'BzrDir.find_repository', 'breezy.bzr.smart.bzrdir',
 
600
    'BzrDir.find_repository', 'brzlib.smart.bzrdir',
622
601
    'SmartServerRequestFindRepositoryV1', info='read')
623
602
request_handlers.register_lazy(
624
 
    b'BzrDir.find_repositoryV2', 'breezy.bzr.smart.bzrdir',
 
603
    'BzrDir.find_repositoryV2', 'brzlib.smart.bzrdir',
625
604
    'SmartServerRequestFindRepositoryV2', info='read')
626
605
request_handlers.register_lazy(
627
 
    b'BzrDir.find_repositoryV3', 'breezy.bzr.smart.bzrdir',
 
606
    'BzrDir.find_repositoryV3', 'brzlib.smart.bzrdir',
628
607
    'SmartServerRequestFindRepositoryV3', info='read')
629
608
request_handlers.register_lazy(
630
 
    b'BzrDir.get_branches', 'breezy.bzr.smart.bzrdir',
 
609
    'BzrDir.get_branches', 'brzlib.smart.bzrdir',
631
610
    'SmartServerBzrDirRequestGetBranches', info='read')
632
611
request_handlers.register_lazy(
633
 
    b'BzrDir.get_config_file', 'breezy.bzr.smart.bzrdir',
 
612
    'BzrDir.get_config_file', 'brzlib.smart.bzrdir',
634
613
    'SmartServerBzrDirRequestConfigFile', info='read')
635
614
request_handlers.register_lazy(
636
 
    b'BzrDir.destroy_branch', 'breezy.bzr.smart.bzrdir',
 
615
    'BzrDir.destroy_branch', 'brzlib.smart.bzrdir',
637
616
    'SmartServerBzrDirRequestDestroyBranch', info='semi')
638
617
request_handlers.register_lazy(
639
 
    b'BzrDir.destroy_repository', 'breezy.bzr.smart.bzrdir',
 
618
    'BzrDir.destroy_repository', 'brzlib.smart.bzrdir',
640
619
    'SmartServerBzrDirRequestDestroyRepository', info='semi')
641
620
request_handlers.register_lazy(
642
 
    b'BzrDir.has_workingtree', 'breezy.bzr.smart.bzrdir',
 
621
    'BzrDir.has_workingtree', 'brzlib.smart.bzrdir',
643
622
    'SmartServerBzrDirRequestHasWorkingTree', info='read')
644
623
request_handlers.register_lazy(
645
 
    b'BzrDirFormat.initialize', 'breezy.bzr.smart.bzrdir',
 
624
    'BzrDirFormat.initialize', 'brzlib.smart.bzrdir',
646
625
    'SmartServerRequestInitializeBzrDir', info='semi')
647
626
request_handlers.register_lazy(
648
 
    b'BzrDirFormat.initialize_ex_1.16', 'breezy.bzr.smart.bzrdir',
 
627
    'BzrDirFormat.initialize_ex_1.16', 'brzlib.smart.bzrdir',
649
628
    'SmartServerRequestBzrDirInitializeEx', info='semi')
650
629
request_handlers.register_lazy(
651
 
    b'BzrDir.open', 'breezy.bzr.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
 
630
    'BzrDir.open', 'brzlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
652
631
    info='read')
653
632
request_handlers.register_lazy(
654
 
    b'BzrDir.open_2.1', 'breezy.bzr.smart.bzrdir',
 
633
    'BzrDir.open_2.1', 'brzlib.smart.bzrdir',
655
634
    'SmartServerRequestOpenBzrDir_2_1', info='read')
656
635
request_handlers.register_lazy(
657
 
    b'BzrDir.open_branch', 'breezy.bzr.smart.bzrdir',
 
636
    'BzrDir.open_branch', 'brzlib.smart.bzrdir',
658
637
    'SmartServerRequestOpenBranch', info='read')
659
638
request_handlers.register_lazy(
660
 
    b'BzrDir.open_branchV2', 'breezy.bzr.smart.bzrdir',
 
639
    'BzrDir.open_branchV2', 'brzlib.smart.bzrdir',
661
640
    'SmartServerRequestOpenBranchV2', info='read')
662
641
request_handlers.register_lazy(
663
 
    b'BzrDir.open_branchV3', 'breezy.bzr.smart.bzrdir',
 
642
    'BzrDir.open_branchV3', 'brzlib.smart.bzrdir',
664
643
    'SmartServerRequestOpenBranchV3', info='read')
665
644
request_handlers.register_lazy(
666
 
    b'delete', 'breezy.bzr.smart.vfs', 'DeleteRequest', info='semivfs')
667
 
request_handlers.register_lazy(
668
 
    b'get', 'breezy.bzr.smart.vfs', 'GetRequest', info='read')
669
 
request_handlers.register_lazy(
670
 
    b'get_bundle', 'breezy.bzr.smart.request', 'GetBundleRequest', info='read')
671
 
request_handlers.register_lazy(
672
 
    b'has', 'breezy.bzr.smart.vfs', 'HasRequest', info='read')
673
 
request_handlers.register_lazy(
674
 
    b'hello', 'breezy.bzr.smart.request', 'HelloRequest', info='read')
675
 
request_handlers.register_lazy(
676
 
    b'iter_files_recursive', 'breezy.bzr.smart.vfs', 'IterFilesRecursiveRequest',
 
645
    'delete', 'brzlib.smart.vfs', 'DeleteRequest', info='semivfs')
 
646
request_handlers.register_lazy(
 
647
    'get', 'brzlib.smart.vfs', 'GetRequest', info='read')
 
648
request_handlers.register_lazy(
 
649
    'get_bundle', 'brzlib.smart.request', 'GetBundleRequest', info='read')
 
650
request_handlers.register_lazy(
 
651
    'has', 'brzlib.smart.vfs', 'HasRequest', info='read')
 
652
request_handlers.register_lazy(
 
653
    'hello', 'brzlib.smart.request', 'HelloRequest', info='read')
 
654
request_handlers.register_lazy(
 
655
    'iter_files_recursive', 'brzlib.smart.vfs', 'IterFilesRecursiveRequest',
677
656
    info='read')
678
657
request_handlers.register_lazy(
679
 
    b'list_dir', 'breezy.bzr.smart.vfs', 'ListDirRequest', info='read')
680
 
request_handlers.register_lazy(
681
 
    b'mkdir', 'breezy.bzr.smart.vfs', 'MkdirRequest', info='semivfs')
682
 
request_handlers.register_lazy(
683
 
    b'move', 'breezy.bzr.smart.vfs', 'MoveRequest', info='semivfs')
684
 
request_handlers.register_lazy(
685
 
    b'put', 'breezy.bzr.smart.vfs', 'PutRequest', info='idem')
686
 
request_handlers.register_lazy(
687
 
    b'put_non_atomic', 'breezy.bzr.smart.vfs', 'PutNonAtomicRequest', info='idem')
688
 
request_handlers.register_lazy(
689
 
    b'readv', 'breezy.bzr.smart.vfs', 'ReadvRequest', info='read')
690
 
request_handlers.register_lazy(
691
 
    b'rename', 'breezy.bzr.smart.vfs', 'RenameRequest', info='semivfs')
692
 
request_handlers.register_lazy(
693
 
    b'Repository.add_signature_text', 'breezy.bzr.smart.repository',
 
658
    'list_dir', 'brzlib.smart.vfs', 'ListDirRequest', info='read')
 
659
request_handlers.register_lazy(
 
660
    'mkdir', 'brzlib.smart.vfs', 'MkdirRequest', info='semivfs')
 
661
request_handlers.register_lazy(
 
662
    'move', 'brzlib.smart.vfs', 'MoveRequest', info='semivfs')
 
663
request_handlers.register_lazy(
 
664
    'put', 'brzlib.smart.vfs', 'PutRequest', info='idem')
 
665
request_handlers.register_lazy(
 
666
    'put_non_atomic', 'brzlib.smart.vfs', 'PutNonAtomicRequest', info='idem')
 
667
request_handlers.register_lazy(
 
668
    'readv', 'brzlib.smart.vfs', 'ReadvRequest', info='read')
 
669
request_handlers.register_lazy(
 
670
    'rename', 'brzlib.smart.vfs', 'RenameRequest', info='semivfs')
 
671
request_handlers.register_lazy(
 
672
    'Repository.add_signature_text', 'brzlib.smart.repository',
694
673
    'SmartServerRepositoryAddSignatureText', info='idem')
695
674
request_handlers.register_lazy(
696
 
    b'Repository.annotate_file_revision', 'breezy.bzr.smart.repository',
697
 
    'SmartServerRepositoryAnnotateFileRevision', info='read')
698
 
request_handlers.register_lazy(
699
 
    b'Repository.all_revision_ids', 'breezy.bzr.smart.repository',
 
675
    'Repository.all_revision_ids', 'brzlib.smart.repository',
700
676
    'SmartServerRepositoryAllRevisionIds', info='read')
701
677
request_handlers.register_lazy(
702
 
    b'PackRepository.autopack', 'breezy.bzr.smart.packrepository',
 
678
    'PackRepository.autopack', 'brzlib.smart.packrepository',
703
679
    'SmartServerPackRepositoryAutopack', info='idem')
704
680
request_handlers.register_lazy(
705
 
    b'Repository.break_lock', 'breezy.bzr.smart.repository',
 
681
    'Repository.break_lock', 'brzlib.smart.repository',
706
682
    'SmartServerRepositoryBreakLock', info='idem')
707
683
request_handlers.register_lazy(
708
 
    b'Repository.gather_stats', 'breezy.bzr.smart.repository',
 
684
    'Repository.gather_stats', 'brzlib.smart.repository',
709
685
    'SmartServerRepositoryGatherStats', info='read')
710
686
request_handlers.register_lazy(
711
 
    b'Repository.get_parent_map', 'breezy.bzr.smart.repository',
 
687
    'Repository.get_parent_map', 'brzlib.smart.repository',
712
688
    'SmartServerRepositoryGetParentMap', info='read')
713
689
request_handlers.register_lazy(
714
 
    b'Repository.get_revision_graph', 'breezy.bzr.smart.repository',
 
690
    'Repository.get_revision_graph', 'brzlib.smart.repository',
715
691
    'SmartServerRepositoryGetRevisionGraph', info='read')
716
692
request_handlers.register_lazy(
717
 
    b'Repository.get_revision_signature_text', 'breezy.bzr.smart.repository',
 
693
    'Repository.get_revision_signature_text', 'brzlib.smart.repository',
718
694
    'SmartServerRepositoryGetRevisionSignatureText', info='read')
719
695
request_handlers.register_lazy(
720
 
    b'Repository.has_revision', 'breezy.bzr.smart.repository',
 
696
    'Repository.has_revision', 'brzlib.smart.repository',
721
697
    'SmartServerRequestHasRevision', info='read')
722
698
request_handlers.register_lazy(
723
 
    b'Repository.has_signature_for_revision_id', 'breezy.bzr.smart.repository',
 
699
    'Repository.has_signature_for_revision_id', 'brzlib.smart.repository',
724
700
    'SmartServerRequestHasSignatureForRevisionId', info='read')
725
701
request_handlers.register_lazy(
726
 
    b'Repository.insert_stream', 'breezy.bzr.smart.repository',
 
702
    'Repository.insert_stream', 'brzlib.smart.repository',
727
703
    'SmartServerRepositoryInsertStream', info='stream')
728
704
request_handlers.register_lazy(
729
 
    b'Repository.insert_stream_1.19', 'breezy.bzr.smart.repository',
 
705
    'Repository.insert_stream_1.19', 'brzlib.smart.repository',
730
706
    'SmartServerRepositoryInsertStream_1_19', info='stream')
731
707
request_handlers.register_lazy(
732
 
    b'Repository.insert_stream_locked', 'breezy.bzr.smart.repository',
 
708
    'Repository.insert_stream_locked', 'brzlib.smart.repository',
733
709
    'SmartServerRepositoryInsertStreamLocked', info='stream')
734
710
request_handlers.register_lazy(
735
 
    b'Repository.is_shared', 'breezy.bzr.smart.repository',
 
711
    'Repository.is_shared', 'brzlib.smart.repository',
736
712
    'SmartServerRepositoryIsShared', info='read')
737
713
request_handlers.register_lazy(
738
 
    b'Repository.iter_files_bytes', 'breezy.bzr.smart.repository',
 
714
    'Repository.iter_files_bytes', 'brzlib.smart.repository',
739
715
    'SmartServerRepositoryIterFilesBytes', info='read')
740
716
request_handlers.register_lazy(
741
 
    b'Repository.lock_write', 'breezy.bzr.smart.repository',
 
717
    'Repository.lock_write', 'brzlib.smart.repository',
742
718
    'SmartServerRepositoryLockWrite', info='semi')
743
719
request_handlers.register_lazy(
744
 
    b'Repository.make_working_trees', 'breezy.bzr.smart.repository',
 
720
    'Repository.make_working_trees', 'brzlib.smart.repository',
745
721
    'SmartServerRepositoryMakeWorkingTrees', info='read')
746
722
request_handlers.register_lazy(
747
 
    b'Repository.set_make_working_trees', 'breezy.bzr.smart.repository',
 
723
    'Repository.set_make_working_trees', 'brzlib.smart.repository',
748
724
    'SmartServerRepositorySetMakeWorkingTrees', info='idem')
749
725
request_handlers.register_lazy(
750
 
    b'Repository.unlock', 'breezy.bzr.smart.repository',
 
726
    'Repository.unlock', 'brzlib.smart.repository',
751
727
    'SmartServerRepositoryUnlock', info='semi')
752
728
request_handlers.register_lazy(
753
 
    b'Repository.get_physical_lock_status', 'breezy.bzr.smart.repository',
 
729
    'Repository.get_physical_lock_status', 'brzlib.smart.repository',
754
730
    'SmartServerRepositoryGetPhysicalLockStatus', info='read')
755
731
request_handlers.register_lazy(
756
 
    b'Repository.get_rev_id_for_revno', 'breezy.bzr.smart.repository',
 
732
    'Repository.get_rev_id_for_revno', 'brzlib.smart.repository',
757
733
    'SmartServerRepositoryGetRevIdForRevno', info='read')
758
734
request_handlers.register_lazy(
759
 
    b'Repository.get_stream', 'breezy.bzr.smart.repository',
 
735
    'Repository.get_stream', 'brzlib.smart.repository',
760
736
    'SmartServerRepositoryGetStream', info='read')
761
737
request_handlers.register_lazy(
762
 
    b'Repository.get_stream_1.19', 'breezy.bzr.smart.repository',
 
738
    'Repository.get_stream_1.19', 'brzlib.smart.repository',
763
739
    'SmartServerRepositoryGetStream_1_19', info='read')
764
740
request_handlers.register_lazy(
765
 
    b'Repository.get_stream_for_missing_keys', 'breezy.bzr.smart.repository',
766
 
    'SmartServerRepositoryGetStreamForMissingKeys', info='read')
767
 
request_handlers.register_lazy(
768
 
    b'Repository.iter_revisions', 'breezy.bzr.smart.repository',
 
741
    'Repository.iter_revisions', 'brzlib.smart.repository',
769
742
    'SmartServerRepositoryIterRevisions', info='read')
770
743
request_handlers.register_lazy(
771
 
    b'Repository.pack', 'breezy.bzr.smart.repository',
 
744
    'Repository.pack', 'brzlib.smart.repository',
772
745
    'SmartServerRepositoryPack', info='idem')
773
746
request_handlers.register_lazy(
774
 
    b'Repository.start_write_group', 'breezy.bzr.smart.repository',
 
747
    'Repository.start_write_group', 'brzlib.smart.repository',
775
748
    'SmartServerRepositoryStartWriteGroup', info='semi')
776
749
request_handlers.register_lazy(
777
 
    b'Repository.commit_write_group', 'breezy.bzr.smart.repository',
 
750
    'Repository.commit_write_group', 'brzlib.smart.repository',
778
751
    'SmartServerRepositoryCommitWriteGroup', info='semi')
779
752
request_handlers.register_lazy(
780
 
    b'Repository.abort_write_group', 'breezy.bzr.smart.repository',
 
753
    'Repository.abort_write_group', 'brzlib.smart.repository',
781
754
    'SmartServerRepositoryAbortWriteGroup', info='semi')
782
755
request_handlers.register_lazy(
783
 
    b'Repository.check_write_group', 'breezy.bzr.smart.repository',
 
756
    'Repository.check_write_group', 'brzlib.smart.repository',
784
757
    'SmartServerRepositoryCheckWriteGroup', info='read')
785
758
request_handlers.register_lazy(
786
 
    b'Repository.reconcile', 'breezy.bzr.smart.repository',
 
759
    'Repository.reconcile', 'brzlib.smart.repository',
787
760
    'SmartServerRepositoryReconcile', info='idem')
788
761
request_handlers.register_lazy(
789
 
    b'Repository.revision_archive', 'breezy.bzr.smart.repository',
790
 
    'SmartServerRepositoryRevisionArchive', info='read')
791
 
request_handlers.register_lazy(
792
 
    b'Repository.tarball', 'breezy.bzr.smart.repository',
 
762
    'Repository.tarball', 'brzlib.smart.repository',
793
763
    'SmartServerRepositoryTarball', info='read')
794
764
request_handlers.register_lazy(
795
 
    b'VersionedFileRepository.get_serializer_format', 'breezy.bzr.smart.repository',
 
765
    'VersionedFileRepository.get_serializer_format', 'brzlib.smart.repository',
796
766
    'SmartServerRepositoryGetSerializerFormat', info='read')
797
767
request_handlers.register_lazy(
798
 
    b'VersionedFileRepository.get_inventories', 'breezy.bzr.smart.repository',
 
768
    'VersionedFileRepository.get_inventories', 'brzlib.smart.repository',
799
769
    'SmartServerRepositoryGetInventories', info='read')
800
770
request_handlers.register_lazy(
801
 
    b'rmdir', 'breezy.bzr.smart.vfs', 'RmdirRequest', info='semivfs')
802
 
request_handlers.register_lazy(
803
 
    b'stat', 'breezy.bzr.smart.vfs', 'StatRequest', info='read')
804
 
request_handlers.register_lazy(
805
 
    b'Transport.is_readonly', 'breezy.bzr.smart.request',
 
771
    'rmdir', 'brzlib.smart.vfs', 'RmdirRequest', info='semivfs')
 
772
request_handlers.register_lazy(
 
773
    'stat', 'brzlib.smart.vfs', 'StatRequest', info='read')
 
774
request_handlers.register_lazy(
 
775
    'Transport.is_readonly', 'brzlib.smart.request',
806
776
    'SmartServerIsReadonly', info='read')