/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: Marius Kruger
  • Date: 2010-07-10 21:28:56 UTC
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100710212856-uq4ji3go0u5se7hx
* Update documentation
* add NEWS

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