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