/brz/remove-bazaar

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

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
26
26
      of times during a request).
27
27
"""
28
28
 
29
 
from __future__ import absolute_import
30
 
 
31
29
# XXX: The class names are a little confusing: the protocol will instantiate a
32
30
# SmartServerRequestHandler, whose dispatch_command method creates an instance
33
31
# of a SmartServerRequest subclass.
34
32
 
35
33
 
 
34
import tempfile
 
35
import thread
36
36
import threading
37
37
 
38
 
from ... import (
39
 
    branch as _mod_branch,
 
38
from bzrlib import (
 
39
    bzrdir,
40
40
    debug,
41
41
    errors,
42
42
    osutils,
45
45
    trace,
46
46
    urlutils,
47
47
    )
48
 
from ...lazy_import import lazy_import
 
48
from bzrlib.lazy_import import lazy_import
49
49
lazy_import(globals(), """
50
 
from breezy.bzr import bzrdir
51
 
from breezy.bundle import serializer
52
 
 
53
 
import tempfile
54
 
import thread
 
50
from bzrlib.bundle import serializer
55
51
""")
56
52
 
57
53
 
59
55
jail_info.transports = None
60
56
 
61
57
 
62
 
class DisabledMethod(errors.InternalBzrError):
63
 
 
64
 
    _fmt = "The smart server method '%(class_name)s' is disabled."
65
 
 
66
 
    def __init__(self, class_name):
67
 
        errors.BzrError.__init__(self)
68
 
        self.class_name = class_name
69
 
 
70
 
 
71
58
def _install_hook():
72
59
    bzrdir.BzrDir.hooks.install_named_hook(
73
60
        'pre_open', _pre_open_hook, 'checking server jail')
147
134
        It will return a SmartServerResponse if the command does not expect a
148
135
        body.
149
136
 
150
 
        :param args: the arguments of the request.
 
137
        :param *args: the arguments of the request.
151
138
        """
152
139
        self._check_enabled()
153
140
        return self.do(*args)
159
146
 
160
147
        Must return a SmartServerResponse.
161
148
        """
162
 
        if body_bytes != b'':
 
149
        if body_bytes != '':
163
150
            raise errors.SmartProtocolError('Request does not expect a body')
164
151
 
165
152
    def do_chunk(self, chunk_bytes):
171
158
 
172
159
    def do_end(self):
173
160
        """Called when the end of the request has been received."""
174
 
        body_bytes = b''.join(self._body_chunks)
 
161
        body_bytes = ''.join(self._body_chunks)
175
162
        self._body_chunks = None
176
163
        return self.do_body(body_bytes)
177
164
 
192
179
            (unlike the untranslated client_path, which must not be used with
193
180
            the backing transport).
194
181
        """
195
 
        client_path = client_path.decode('utf-8')
196
182
        if self._root_client_path is None:
197
183
            # no translation necessary!
198
184
            return client_path
217
203
        :returns: a transport cloned from self._backing_transport
218
204
        """
219
205
        relpath = self.translate_client_path(client_path)
220
 
        if not isinstance(relpath, str):
221
 
            raise TypeError(relpath)
222
206
        return self._backing_transport.clone(relpath)
223
207
 
224
208
 
295
279
 
296
280
        :param backing_transport: a Transport to handle requests for.
297
281
        :param commands: a registry mapping command names to SmartServerRequest
298
 
            subclasses. e.g. breezy.transport.smart.vfs.vfs_commands.
 
282
            subclasses. e.g. bzrlib.transport.smart.vfs.vfs_commands.
299
283
        """
300
284
        self._backing_transport = backing_transport
301
285
        self._root_client_path = root_client_path
311
295
            self._thread_id = thread.get_ident()
312
296
 
313
297
    def _trace(self, action, message, extra_bytes=None, include_time=False):
314
 
        # It is a bit of a shame that this functionality overlaps with that of
 
298
        # It is a bit of a shame that this functionality overlaps with that of 
315
299
        # ProtocolThreeRequester._trace. However, there is enough difference
316
300
        # that just putting it in a helper doesn't help a lot. And some state
317
301
        # is taken from the instance.
373
357
                self._command.teardown_jail()
374
358
        except (KeyboardInterrupt, SystemExit):
375
359
            raise
376
 
        except Exception as err:
 
360
        except Exception, err:
377
361
            err_struct = _translate_error(err)
378
362
            return FailedSmartServerResponse(err_struct)
379
363
 
389
373
            command = self._commands.get(cmd)
390
374
        except LookupError:
391
375
            if 'hpss' in debug.debug_flags:
392
 
                self._trace('hpss unknown request',
 
376
                self._trace('hpss unknown request', 
393
377
                            cmd, repr(args)[1:-1])
394
378
            raise errors.UnknownSmartMethod(cmd)
395
379
        if 'hpss' in debug.debug_flags:
396
 
            from . import vfs
 
380
            from bzrlib.smart import vfs
397
381
            if issubclass(command, vfs.VfsRequest):
398
382
                action = 'hpss vfs req'
399
383
            else:
400
384
                action = 'hpss request'
401
 
            self._trace(action, '%s %s' % (cmd, repr(args)[1:-1]))
 
385
            self._trace(action, 
 
386
                        '%s %s' % (cmd, repr(args)[1:-1]))
402
387
        self._command = command(
403
388
            self._backing_transport, self._root_client_path, self._jail_root)
404
389
        self._run_handler_code(self._command.execute, args, {})
418
403
 
419
404
def _translate_error(err):
420
405
    if isinstance(err, errors.NoSuchFile):
421
 
        return (b'NoSuchFile', err.path.encode('utf-8'))
 
406
        return ('NoSuchFile', err.path)
422
407
    elif isinstance(err, errors.FileExists):
423
 
        return (b'FileExists', err.path.encode('utf-8'))
 
408
        return ('FileExists', err.path)
424
409
    elif isinstance(err, errors.DirectoryNotEmpty):
425
 
        return (b'DirectoryNotEmpty', err.path.encode('utf-8'))
 
410
        return ('DirectoryNotEmpty', err.path)
426
411
    elif isinstance(err, errors.IncompatibleRepositories):
427
 
        return (b'IncompatibleRepositories', str(err.source), str(err.target),
 
412
        return ('IncompatibleRepositories', str(err.source), str(err.target),
428
413
            str(err.details))
429
414
    elif isinstance(err, errors.ShortReadvError):
430
 
        return (b'ShortReadvError', err.path.encode('utf-8'),
431
 
                str(err.offset).encode('ascii'),
432
 
                str(err.length).encode('ascii'),
433
 
                str(err.actual).encode('ascii'))
434
 
    elif isinstance(err, errors.RevisionNotPresent):
435
 
        return (b'RevisionNotPresent', err.revision_id, err.file_id)
 
415
        return ('ShortReadvError', err.path, str(err.offset), str(err.length),
 
416
                str(err.actual))
436
417
    elif isinstance(err, errors.UnstackableRepositoryFormat):
437
 
        return ((b'UnstackableRepositoryFormat',
438
 
            str(err.format).encode('utf-8'), err.url.encode('utf-8')))
439
 
    elif isinstance(err, _mod_branch.UnstackableBranchFormat):
440
 
        return (b'UnstackableBranchFormat', str(err.format).encode('utf-8'),
441
 
                err.url.encode('utf-8'))
 
418
        return (('UnstackableRepositoryFormat', str(err.format), err.url))
 
419
    elif isinstance(err, errors.UnstackableBranchFormat):
 
420
        return ('UnstackableBranchFormat', str(err.format), err.url)
442
421
    elif isinstance(err, errors.NotStacked):
443
 
        return (b'NotStacked',)
444
 
    elif isinstance(err, errors.BzrCheckError):
445
 
        return (b'BzrCheckError', err.msg.encode('utf-8'))
 
422
        return ('NotStacked',)
446
423
    elif isinstance(err, UnicodeError):
447
424
        # If it is a DecodeError, than most likely we are starting
448
425
        # with a plain string
459
436
                str(err.end), err.reason)
460
437
    elif isinstance(err, errors.TransportNotPossible):
461
438
        if err.msg == "readonly transport":
462
 
            return (b'ReadOnlyError', )
 
439
            return ('ReadOnlyError', )
463
440
    elif isinstance(err, errors.ReadError):
464
441
        # cannot read the file
465
 
        return (b'ReadError', err.path)
 
442
        return ('ReadError', err.path)
466
443
    elif isinstance(err, errors.PermissionDenied):
467
 
        return (b'PermissionDenied', err.path.encode('utf-8'), err.extra.encode('utf-8'))
 
444
        return ('PermissionDenied', err.path, err.extra)
468
445
    elif isinstance(err, errors.TokenMismatch):
469
 
        return (b'TokenMismatch', err.given_token, err.lock_token)
 
446
        return ('TokenMismatch', err.given_token, err.lock_token)
470
447
    elif isinstance(err, errors.LockContention):
471
 
        return (b'LockContention',)
472
 
    elif isinstance(err, errors.GhostRevisionsHaveNoRevno):
473
 
        return (b'GhostRevisionsHaveNoRevno', err.revision_id, err.ghost_revision_id)
474
 
    elif isinstance(err, MemoryError):
475
 
        # GZ 2011-02-24: Copy breezy.trace -Dmem_dump functionality here?
476
 
        return (b'MemoryError',)
 
448
        return ('LockContention',)
477
449
    # Unserialisable error.  Log it, and return a generic error
478
450
    trace.log_exception_quietly()
479
 
    return (b'error',
480
 
            trace._qualified_exception_name(err.__class__, True).encode('utf-8'),
481
 
            str(err).encode('utf-8'))
 
451
    return ('error', str(err))
482
452
 
483
453
 
484
454
class HelloRequest(SmartServerRequest):
487
457
    """
488
458
 
489
459
    def do(self):
490
 
        return SuccessfulSmartServerResponse((b'ok', b'2'))
 
460
        return SuccessfulSmartServerResponse(('ok', '2'))
491
461
 
492
462
 
493
463
class GetBundleRequest(SmartServerRequest):
510
480
 
511
481
    def do(self):
512
482
        if self._backing_transport.is_readonly():
513
 
            answer = b'yes'
 
483
            answer = 'yes'
514
484
        else:
515
 
            answer = b'no'
 
485
            answer = 'no'
516
486
        return SuccessfulSmartServerResponse((answer,))
517
487
 
518
488
 
519
 
# In the 'info' attribute, we store whether this request is 'safe' to retry if
520
 
# we get a disconnect while reading the response. It can have the values:
521
 
#   read    This is purely a read request, so retrying it is perfectly ok.
522
 
#   idem    An idempotent write request. Something like 'put' where if you put
523
 
#           the same bytes twice you end up with the same final bytes.
524
 
#   semi    This is a request that isn't strictly idempotent, but doesn't
525
 
#           result in corruption if it is retried. This is for things like
526
 
#           'lock' and 'unlock'. If you call lock, it updates the disk
527
 
#           structure. If you fail to read the response, you won't be able to
528
 
#           use the lock, because you don't have the lock token. Calling lock
529
 
#           again will fail, because the lock is already taken. However, we
530
 
#           can't tell if the server received our request or not. If it didn't,
531
 
#           then retrying the request is fine, as it will actually do what we
532
 
#           want. If it did, we will interrupt the current operation, but we
533
 
#           are no worse off than interrupting the current operation because of
534
 
#           a ConnectionReset.
535
 
#   semivfs Similar to semi, but specific to a Virtual FileSystem request.
536
 
#   stream  This is a request that takes a stream that cannot be restarted if
537
 
#           consumed. This request is 'safe' in that if we determine the
538
 
#           connection is closed before we consume the stream, we can try
539
 
#           again.
540
 
#   mutate  State is updated in a way that replaying that request results in a
541
 
#           different state. For example 'append' writes more bytes to a given
542
 
#           file. If append succeeds, it moves the file pointer.
543
489
request_handlers = registry.Registry()
544
490
request_handlers.register_lazy(
545
 
    b'append', 'breezy.bzr.smart.vfs', 'AppendRequest', info='mutate')
546
 
request_handlers.register_lazy(
547
 
    b'Branch.break_lock', 'breezy.bzr.smart.branch',
548
 
    'SmartServerBranchBreakLock', info='idem')
549
 
request_handlers.register_lazy(
550
 
    b'Branch.get_config_file', 'breezy.bzr.smart.branch',
551
 
    'SmartServerBranchGetConfigFile', info='read')
552
 
request_handlers.register_lazy(
553
 
    b'Branch.get_parent', 'breezy.bzr.smart.branch', 'SmartServerBranchGetParent',
554
 
    info='read')
555
 
request_handlers.register_lazy(
556
 
    b'Branch.put_config_file', 'breezy.bzr.smart.branch',
557
 
    'SmartServerBranchPutConfigFile', info='idem')
558
 
request_handlers.register_lazy(
559
 
    b'Branch.get_tags_bytes', 'breezy.bzr.smart.branch',
560
 
    'SmartServerBranchGetTagsBytes', info='read')
561
 
request_handlers.register_lazy(
562
 
    b'Branch.set_tags_bytes', 'breezy.bzr.smart.branch',
563
 
    'SmartServerBranchSetTagsBytes', info='idem')
564
 
request_handlers.register_lazy(
565
 
    b'Branch.heads_to_fetch', 'breezy.bzr.smart.branch',
566
 
    'SmartServerBranchHeadsToFetch', info='read')
567
 
request_handlers.register_lazy(
568
 
    b'Branch.get_stacked_on_url', 'breezy.bzr.smart.branch',
569
 
    'SmartServerBranchRequestGetStackedOnURL', info='read')
570
 
request_handlers.register_lazy(
571
 
    b'Branch.get_physical_lock_status', 'breezy.bzr.smart.branch',
572
 
    'SmartServerBranchRequestGetPhysicalLockStatus', info='read')
573
 
request_handlers.register_lazy(
574
 
    b'Branch.last_revision_info', 'breezy.bzr.smart.branch',
575
 
    'SmartServerBranchRequestLastRevisionInfo', info='read')
576
 
request_handlers.register_lazy(
577
 
    b'Branch.lock_write', 'breezy.bzr.smart.branch',
578
 
    'SmartServerBranchRequestLockWrite', info='semi')
579
 
request_handlers.register_lazy(
580
 
    b'Branch.revision_history', 'breezy.bzr.smart.branch',
581
 
    'SmartServerRequestRevisionHistory', info='read')
582
 
request_handlers.register_lazy(
583
 
    b'Branch.set_config_option', 'breezy.bzr.smart.branch',
584
 
    'SmartServerBranchRequestSetConfigOption', info='idem')
585
 
request_handlers.register_lazy(
586
 
    b'Branch.set_config_option_dict', 'breezy.bzr.smart.branch',
587
 
    'SmartServerBranchRequestSetConfigOptionDict', info='idem')
588
 
request_handlers.register_lazy(
589
 
    b'Branch.set_last_revision', 'breezy.bzr.smart.branch',
590
 
    'SmartServerBranchRequestSetLastRevision', info='idem')
591
 
request_handlers.register_lazy(
592
 
    b'Branch.set_last_revision_info', 'breezy.bzr.smart.branch',
593
 
    'SmartServerBranchRequestSetLastRevisionInfo', info='idem')
594
 
request_handlers.register_lazy(
595
 
    b'Branch.set_last_revision_ex', 'breezy.bzr.smart.branch',
596
 
    'SmartServerBranchRequestSetLastRevisionEx', info='idem')
597
 
request_handlers.register_lazy(
598
 
    b'Branch.set_parent_location', 'breezy.bzr.smart.branch',
599
 
    'SmartServerBranchRequestSetParentLocation', info='idem')
600
 
request_handlers.register_lazy(
601
 
    b'Branch.unlock', 'breezy.bzr.smart.branch',
602
 
    'SmartServerBranchRequestUnlock', info='semi')
603
 
request_handlers.register_lazy(
604
 
    b'Branch.revision_id_to_revno', 'breezy.bzr.smart.branch',
605
 
    'SmartServerBranchRequestRevisionIdToRevno', info='read')
606
 
request_handlers.register_lazy(
607
 
    b'BzrDir.checkout_metadir', 'breezy.bzr.smart.bzrdir',
608
 
    'SmartServerBzrDirRequestCheckoutMetaDir', info='read')
609
 
request_handlers.register_lazy(
610
 
    b'BzrDir.cloning_metadir', 'breezy.bzr.smart.bzrdir',
611
 
    'SmartServerBzrDirRequestCloningMetaDir', info='read')
612
 
request_handlers.register_lazy(
613
 
    b'BzrDir.create_branch', 'breezy.bzr.smart.bzrdir',
614
 
    'SmartServerRequestCreateBranch', info='semi')
615
 
request_handlers.register_lazy(
616
 
    b'BzrDir.create_repository', 'breezy.bzr.smart.bzrdir',
617
 
    'SmartServerRequestCreateRepository', info='semi')
618
 
request_handlers.register_lazy(
619
 
    b'BzrDir.find_repository', 'breezy.bzr.smart.bzrdir',
620
 
    'SmartServerRequestFindRepositoryV1', info='read')
621
 
request_handlers.register_lazy(
622
 
    b'BzrDir.find_repositoryV2', 'breezy.bzr.smart.bzrdir',
623
 
    'SmartServerRequestFindRepositoryV2', info='read')
624
 
request_handlers.register_lazy(
625
 
    b'BzrDir.find_repositoryV3', 'breezy.bzr.smart.bzrdir',
626
 
    'SmartServerRequestFindRepositoryV3', info='read')
627
 
request_handlers.register_lazy(
628
 
    b'BzrDir.get_branches', 'breezy.bzr.smart.bzrdir',
629
 
    'SmartServerBzrDirRequestGetBranches', info='read')
630
 
request_handlers.register_lazy(
631
 
    b'BzrDir.get_config_file', 'breezy.bzr.smart.bzrdir',
632
 
    'SmartServerBzrDirRequestConfigFile', info='read')
633
 
request_handlers.register_lazy(
634
 
    b'BzrDir.destroy_branch', 'breezy.bzr.smart.bzrdir',
635
 
    'SmartServerBzrDirRequestDestroyBranch', info='semi')
636
 
request_handlers.register_lazy(
637
 
    b'BzrDir.destroy_repository', 'breezy.bzr.smart.bzrdir',
638
 
    'SmartServerBzrDirRequestDestroyRepository', info='semi')
639
 
request_handlers.register_lazy(
640
 
    b'BzrDir.has_workingtree', 'breezy.bzr.smart.bzrdir',
641
 
    'SmartServerBzrDirRequestHasWorkingTree', info='read')
642
 
request_handlers.register_lazy(
643
 
    b'BzrDirFormat.initialize', 'breezy.bzr.smart.bzrdir',
644
 
    'SmartServerRequestInitializeBzrDir', info='semi')
645
 
request_handlers.register_lazy(
646
 
    b'BzrDirFormat.initialize_ex_1.16', 'breezy.bzr.smart.bzrdir',
647
 
    'SmartServerRequestBzrDirInitializeEx', info='semi')
648
 
request_handlers.register_lazy(
649
 
    b'BzrDir.open', 'breezy.bzr.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
650
 
    info='read')
651
 
request_handlers.register_lazy(
652
 
    b'BzrDir.open_2.1', 'breezy.bzr.smart.bzrdir',
653
 
    'SmartServerRequestOpenBzrDir_2_1', info='read')
654
 
request_handlers.register_lazy(
655
 
    b'BzrDir.open_branch', 'breezy.bzr.smart.bzrdir',
656
 
    'SmartServerRequestOpenBranch', info='read')
657
 
request_handlers.register_lazy(
658
 
    b'BzrDir.open_branchV2', 'breezy.bzr.smart.bzrdir',
659
 
    'SmartServerRequestOpenBranchV2', info='read')
660
 
request_handlers.register_lazy(
661
 
    b'BzrDir.open_branchV3', 'breezy.bzr.smart.bzrdir',
662
 
    'SmartServerRequestOpenBranchV3', info='read')
663
 
request_handlers.register_lazy(
664
 
    b'delete', 'breezy.bzr.smart.vfs', 'DeleteRequest', info='semivfs')
665
 
request_handlers.register_lazy(
666
 
    b'get', 'breezy.bzr.smart.vfs', 'GetRequest', info='read')
667
 
request_handlers.register_lazy(
668
 
    b'get_bundle', 'breezy.bzr.smart.request', 'GetBundleRequest', info='read')
669
 
request_handlers.register_lazy(
670
 
    b'has', 'breezy.bzr.smart.vfs', 'HasRequest', info='read')
671
 
request_handlers.register_lazy(
672
 
    b'hello', 'breezy.bzr.smart.request', 'HelloRequest', info='read')
673
 
request_handlers.register_lazy(
674
 
    b'iter_files_recursive', 'breezy.bzr.smart.vfs', 'IterFilesRecursiveRequest',
675
 
    info='read')
676
 
request_handlers.register_lazy(
677
 
    b'list_dir', 'breezy.bzr.smart.vfs', 'ListDirRequest', info='read')
678
 
request_handlers.register_lazy(
679
 
    b'mkdir', 'breezy.bzr.smart.vfs', 'MkdirRequest', info='semivfs')
680
 
request_handlers.register_lazy(
681
 
    b'move', 'breezy.bzr.smart.vfs', 'MoveRequest', info='semivfs')
682
 
request_handlers.register_lazy(
683
 
    b'put', 'breezy.bzr.smart.vfs', 'PutRequest', info='idem')
684
 
request_handlers.register_lazy(
685
 
    b'put_non_atomic', 'breezy.bzr.smart.vfs', 'PutNonAtomicRequest', info='idem')
686
 
request_handlers.register_lazy(
687
 
    b'readv', 'breezy.bzr.smart.vfs', 'ReadvRequest', info='read')
688
 
request_handlers.register_lazy(
689
 
    b'rename', 'breezy.bzr.smart.vfs', 'RenameRequest', info='semivfs')
690
 
request_handlers.register_lazy(
691
 
    b'Repository.add_signature_text', 'breezy.bzr.smart.repository',
692
 
    'SmartServerRepositoryAddSignatureText', info='idem')
693
 
request_handlers.register_lazy(
694
 
    b'Repository.all_revision_ids', 'breezy.bzr.smart.repository',
695
 
    'SmartServerRepositoryAllRevisionIds', info='read')
696
 
request_handlers.register_lazy(
697
 
    b'PackRepository.autopack', 'breezy.bzr.smart.packrepository',
698
 
    'SmartServerPackRepositoryAutopack', info='idem')
699
 
request_handlers.register_lazy(
700
 
    b'Repository.break_lock', 'breezy.bzr.smart.repository',
701
 
    'SmartServerRepositoryBreakLock', info='idem')
702
 
request_handlers.register_lazy(
703
 
    b'Repository.gather_stats', 'breezy.bzr.smart.repository',
704
 
    'SmartServerRepositoryGatherStats', info='read')
705
 
request_handlers.register_lazy(
706
 
    b'Repository.get_parent_map', 'breezy.bzr.smart.repository',
707
 
    'SmartServerRepositoryGetParentMap', info='read')
708
 
request_handlers.register_lazy(
709
 
    b'Repository.get_revision_graph', 'breezy.bzr.smart.repository',
710
 
    'SmartServerRepositoryGetRevisionGraph', info='read')
711
 
request_handlers.register_lazy(
712
 
    b'Repository.get_revision_signature_text', 'breezy.bzr.smart.repository',
713
 
    'SmartServerRepositoryGetRevisionSignatureText', info='read')
714
 
request_handlers.register_lazy(
715
 
    b'Repository.has_revision', 'breezy.bzr.smart.repository',
716
 
    'SmartServerRequestHasRevision', info='read')
717
 
request_handlers.register_lazy(
718
 
    b'Repository.has_signature_for_revision_id', 'breezy.bzr.smart.repository',
719
 
    'SmartServerRequestHasSignatureForRevisionId', info='read')
720
 
request_handlers.register_lazy(
721
 
    b'Repository.insert_stream', 'breezy.bzr.smart.repository',
722
 
    'SmartServerRepositoryInsertStream', info='stream')
723
 
request_handlers.register_lazy(
724
 
    b'Repository.insert_stream_1.19', 'breezy.bzr.smart.repository',
725
 
    'SmartServerRepositoryInsertStream_1_19', info='stream')
726
 
request_handlers.register_lazy(
727
 
    b'Repository.insert_stream_locked', 'breezy.bzr.smart.repository',
728
 
    'SmartServerRepositoryInsertStreamLocked', info='stream')
729
 
request_handlers.register_lazy(
730
 
    b'Repository.is_shared', 'breezy.bzr.smart.repository',
731
 
    'SmartServerRepositoryIsShared', info='read')
732
 
request_handlers.register_lazy(
733
 
    b'Repository.iter_files_bytes', 'breezy.bzr.smart.repository',
734
 
    'SmartServerRepositoryIterFilesBytes', info='read')
735
 
request_handlers.register_lazy(
736
 
    b'Repository.lock_write', 'breezy.bzr.smart.repository',
737
 
    'SmartServerRepositoryLockWrite', info='semi')
738
 
request_handlers.register_lazy(
739
 
    b'Repository.make_working_trees', 'breezy.bzr.smart.repository',
740
 
    'SmartServerRepositoryMakeWorkingTrees', info='read')
741
 
request_handlers.register_lazy(
742
 
    b'Repository.set_make_working_trees', 'breezy.bzr.smart.repository',
743
 
    'SmartServerRepositorySetMakeWorkingTrees', info='idem')
744
 
request_handlers.register_lazy(
745
 
    b'Repository.unlock', 'breezy.bzr.smart.repository',
746
 
    'SmartServerRepositoryUnlock', info='semi')
747
 
request_handlers.register_lazy(
748
 
    b'Repository.get_physical_lock_status', 'breezy.bzr.smart.repository',
749
 
    'SmartServerRepositoryGetPhysicalLockStatus', info='read')
750
 
request_handlers.register_lazy(
751
 
    b'Repository.get_rev_id_for_revno', 'breezy.bzr.smart.repository',
752
 
    'SmartServerRepositoryGetRevIdForRevno', info='read')
753
 
request_handlers.register_lazy(
754
 
    b'Repository.get_stream', 'breezy.bzr.smart.repository',
755
 
    'SmartServerRepositoryGetStream', info='read')
756
 
request_handlers.register_lazy(
757
 
    b'Repository.get_stream_1.19', 'breezy.bzr.smart.repository',
758
 
    'SmartServerRepositoryGetStream_1_19', info='read')
759
 
request_handlers.register_lazy(
760
 
    b'Repository.iter_revisions', 'breezy.bzr.smart.repository',
761
 
    'SmartServerRepositoryIterRevisions', info='read')
762
 
request_handlers.register_lazy(
763
 
    b'Repository.pack', 'breezy.bzr.smart.repository',
764
 
    'SmartServerRepositoryPack', info='idem')
765
 
request_handlers.register_lazy(
766
 
    b'Repository.start_write_group', 'breezy.bzr.smart.repository',
767
 
    'SmartServerRepositoryStartWriteGroup', info='semi')
768
 
request_handlers.register_lazy(
769
 
    b'Repository.commit_write_group', 'breezy.bzr.smart.repository',
770
 
    'SmartServerRepositoryCommitWriteGroup', info='semi')
771
 
request_handlers.register_lazy(
772
 
    b'Repository.abort_write_group', 'breezy.bzr.smart.repository',
773
 
    'SmartServerRepositoryAbortWriteGroup', info='semi')
774
 
request_handlers.register_lazy(
775
 
    b'Repository.check_write_group', 'breezy.bzr.smart.repository',
776
 
    'SmartServerRepositoryCheckWriteGroup', info='read')
777
 
request_handlers.register_lazy(
778
 
    b'Repository.reconcile', 'breezy.bzr.smart.repository',
779
 
    'SmartServerRepositoryReconcile', info='idem')
780
 
request_handlers.register_lazy(
781
 
    b'Repository.tarball', 'breezy.bzr.smart.repository',
782
 
    'SmartServerRepositoryTarball', info='read')
783
 
request_handlers.register_lazy(
784
 
    b'VersionedFileRepository.get_serializer_format', 'breezy.bzr.smart.repository',
785
 
    'SmartServerRepositoryGetSerializerFormat', info='read')
786
 
request_handlers.register_lazy(
787
 
    b'VersionedFileRepository.get_inventories', 'breezy.bzr.smart.repository',
788
 
    'SmartServerRepositoryGetInventories', info='read')
789
 
request_handlers.register_lazy(
790
 
    b'rmdir', 'breezy.bzr.smart.vfs', 'RmdirRequest', info='semivfs')
791
 
request_handlers.register_lazy(
792
 
    b'stat', 'breezy.bzr.smart.vfs', 'StatRequest', info='read')
793
 
request_handlers.register_lazy(
794
 
    b'Transport.is_readonly', 'breezy.bzr.smart.request',
795
 
    'SmartServerIsReadonly', info='read')
 
491
    'append', 'bzrlib.smart.vfs', 'AppendRequest')
 
492
request_handlers.register_lazy(
 
493
    'Branch.get_config_file', 'bzrlib.smart.branch',
 
494
    'SmartServerBranchGetConfigFile')
 
495
request_handlers.register_lazy(
 
496
    'Branch.get_parent', 'bzrlib.smart.branch', 'SmartServerBranchGetParent')
 
497
request_handlers.register_lazy(
 
498
    'Branch.get_tags_bytes', 'bzrlib.smart.branch',
 
499
    'SmartServerBranchGetTagsBytes')
 
500
request_handlers.register_lazy(
 
501
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
 
502
    'SmartServerBranchSetTagsBytes')
 
503
request_handlers.register_lazy(
 
504
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
 
505
request_handlers.register_lazy(
 
506
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
 
507
request_handlers.register_lazy(
 
508
    'Branch.lock_write', 'bzrlib.smart.branch', 'SmartServerBranchRequestLockWrite')
 
509
request_handlers.register_lazy( 'Branch.revision_history',
 
510
    'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory')
 
511
request_handlers.register_lazy( 'Branch.set_config_option',
 
512
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOption')
 
513
request_handlers.register_lazy( 'Branch.set_last_revision',
 
514
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
 
515
request_handlers.register_lazy(
 
516
    'Branch.set_last_revision_info', 'bzrlib.smart.branch',
 
517
    'SmartServerBranchRequestSetLastRevisionInfo')
 
518
request_handlers.register_lazy(
 
519
    'Branch.set_last_revision_ex', 'bzrlib.smart.branch',
 
520
    'SmartServerBranchRequestSetLastRevisionEx')
 
521
request_handlers.register_lazy(
 
522
    'Branch.set_parent_location', 'bzrlib.smart.branch',
 
523
    'SmartServerBranchRequestSetParentLocation')
 
524
request_handlers.register_lazy(
 
525
    'Branch.unlock', 'bzrlib.smart.branch', 'SmartServerBranchRequestUnlock')
 
526
request_handlers.register_lazy(
 
527
    'BzrDir.cloning_metadir', 'bzrlib.smart.bzrdir',
 
528
    'SmartServerBzrDirRequestCloningMetaDir')
 
529
request_handlers.register_lazy(
 
530
    'BzrDir.create_branch', 'bzrlib.smart.bzrdir',
 
531
    'SmartServerRequestCreateBranch')
 
532
request_handlers.register_lazy(
 
533
    'BzrDir.create_repository', 'bzrlib.smart.bzrdir',
 
534
    'SmartServerRequestCreateRepository')
 
535
request_handlers.register_lazy(
 
536
    'BzrDir.find_repository', 'bzrlib.smart.bzrdir',
 
537
    'SmartServerRequestFindRepositoryV1')
 
538
request_handlers.register_lazy(
 
539
    'BzrDir.find_repositoryV2', 'bzrlib.smart.bzrdir',
 
540
    'SmartServerRequestFindRepositoryV2')
 
541
request_handlers.register_lazy(
 
542
    'BzrDir.find_repositoryV3', 'bzrlib.smart.bzrdir',
 
543
    'SmartServerRequestFindRepositoryV3')
 
544
request_handlers.register_lazy(
 
545
    'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
 
546
    'SmartServerBzrDirRequestConfigFile')
 
547
request_handlers.register_lazy(
 
548
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
 
549
    'SmartServerRequestInitializeBzrDir')
 
550
request_handlers.register_lazy(
 
551
    'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
 
552
    'SmartServerRequestBzrDirInitializeEx')
 
553
request_handlers.register_lazy(
 
554
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')
 
555
request_handlers.register_lazy(
 
556
    'BzrDir.open_2.1', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir_2_1')
 
557
request_handlers.register_lazy(
 
558
    'BzrDir.open_branch', 'bzrlib.smart.bzrdir',
 
559
    'SmartServerRequestOpenBranch')
 
560
request_handlers.register_lazy(
 
561
    'BzrDir.open_branchV2', 'bzrlib.smart.bzrdir',
 
562
    'SmartServerRequestOpenBranchV2')
 
563
request_handlers.register_lazy(
 
564
    'BzrDir.open_branchV3', 'bzrlib.smart.bzrdir',
 
565
    'SmartServerRequestOpenBranchV3')
 
566
request_handlers.register_lazy(
 
567
    'delete', 'bzrlib.smart.vfs', 'DeleteRequest')
 
568
request_handlers.register_lazy(
 
569
    'get', 'bzrlib.smart.vfs', 'GetRequest')
 
570
request_handlers.register_lazy(
 
571
    'get_bundle', 'bzrlib.smart.request', 'GetBundleRequest')
 
572
request_handlers.register_lazy(
 
573
    'has', 'bzrlib.smart.vfs', 'HasRequest')
 
574
request_handlers.register_lazy(
 
575
    'hello', 'bzrlib.smart.request', 'HelloRequest')
 
576
request_handlers.register_lazy(
 
577
    'iter_files_recursive', 'bzrlib.smart.vfs', 'IterFilesRecursiveRequest')
 
578
request_handlers.register_lazy(
 
579
    'list_dir', 'bzrlib.smart.vfs', 'ListDirRequest')
 
580
request_handlers.register_lazy(
 
581
    'mkdir', 'bzrlib.smart.vfs', 'MkdirRequest')
 
582
request_handlers.register_lazy(
 
583
    'move', 'bzrlib.smart.vfs', 'MoveRequest')
 
584
request_handlers.register_lazy(
 
585
    'put', 'bzrlib.smart.vfs', 'PutRequest')
 
586
request_handlers.register_lazy(
 
587
    'put_non_atomic', 'bzrlib.smart.vfs', 'PutNonAtomicRequest')
 
588
request_handlers.register_lazy(
 
589
    'readv', 'bzrlib.smart.vfs', 'ReadvRequest')
 
590
request_handlers.register_lazy(
 
591
    'rename', 'bzrlib.smart.vfs', 'RenameRequest')
 
592
request_handlers.register_lazy(
 
593
    'PackRepository.autopack', 'bzrlib.smart.packrepository',
 
594
    'SmartServerPackRepositoryAutopack')
 
595
request_handlers.register_lazy('Repository.gather_stats',
 
596
                               'bzrlib.smart.repository',
 
597
                               'SmartServerRepositoryGatherStats')
 
598
request_handlers.register_lazy('Repository.get_parent_map',
 
599
                               'bzrlib.smart.repository',
 
600
                               'SmartServerRepositoryGetParentMap')
 
601
request_handlers.register_lazy(
 
602
    'Repository.get_revision_graph', 'bzrlib.smart.repository', 'SmartServerRepositoryGetRevisionGraph')
 
603
request_handlers.register_lazy(
 
604
    'Repository.has_revision', 'bzrlib.smart.repository', 'SmartServerRequestHasRevision')
 
605
request_handlers.register_lazy(
 
606
    'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
 
607
request_handlers.register_lazy(
 
608
    'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
 
609
request_handlers.register_lazy(
 
610
    'Repository.insert_stream_locked', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStreamLocked')
 
611
request_handlers.register_lazy(
 
612
    'Repository.is_shared', 'bzrlib.smart.repository', 'SmartServerRepositoryIsShared')
 
613
request_handlers.register_lazy(
 
614
    'Repository.lock_write', 'bzrlib.smart.repository', 'SmartServerRepositoryLockWrite')
 
615
request_handlers.register_lazy(
 
616
    'Repository.set_make_working_trees', 'bzrlib.smart.repository',
 
617
    'SmartServerRepositorySetMakeWorkingTrees')
 
618
request_handlers.register_lazy(
 
619
    'Repository.unlock', 'bzrlib.smart.repository', 'SmartServerRepositoryUnlock')
 
620
request_handlers.register_lazy(
 
621
    'Repository.get_rev_id_for_revno', 'bzrlib.smart.repository',
 
622
    'SmartServerRepositoryGetRevIdForRevno')
 
623
request_handlers.register_lazy(
 
624
    'Repository.get_stream', 'bzrlib.smart.repository',
 
625
    'SmartServerRepositoryGetStream')
 
626
request_handlers.register_lazy(
 
627
    'Repository.get_stream_1.19', 'bzrlib.smart.repository',
 
628
    'SmartServerRepositoryGetStream_1_19')
 
629
request_handlers.register_lazy(
 
630
    'Repository.tarball', 'bzrlib.smart.repository',
 
631
    'SmartServerRepositoryTarball')
 
632
request_handlers.register_lazy(
 
633
    'rmdir', 'bzrlib.smart.vfs', 'RmdirRequest')
 
634
request_handlers.register_lazy(
 
635
    'stat', 'bzrlib.smart.vfs', 'StatRequest')
 
636
request_handlers.register_lazy(
 
637
    'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly')