/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 (
 
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 import bzrdir
50
 
from breezy.bundle import serializer
51
 
 
52
 
import tempfile
53
 
import thread
 
50
from bzrlib.bundle import serializer
54
51
""")
55
52
 
56
53
 
137
134
        It will return a SmartServerResponse if the command does not expect a
138
135
        body.
139
136
 
140
 
        :param args: the arguments of the request.
 
137
        :param *args: the arguments of the request.
141
138
        """
142
139
        self._check_enabled()
143
140
        return self.do(*args)
282
279
 
283
280
        :param backing_transport: a Transport to handle requests for.
284
281
        :param commands: a registry mapping command names to SmartServerRequest
285
 
            subclasses. e.g. breezy.transport.smart.vfs.vfs_commands.
 
282
            subclasses. e.g. bzrlib.transport.smart.vfs.vfs_commands.
286
283
        """
287
284
        self._backing_transport = backing_transport
288
285
        self._root_client_path = root_client_path
360
357
                self._command.teardown_jail()
361
358
        except (KeyboardInterrupt, SystemExit):
362
359
            raise
363
 
        except Exception as err:
 
360
        except Exception, err:
364
361
            err_struct = _translate_error(err)
365
362
            return FailedSmartServerResponse(err_struct)
366
363
 
380
377
                            cmd, repr(args)[1:-1])
381
378
            raise errors.UnknownSmartMethod(cmd)
382
379
        if 'hpss' in debug.debug_flags:
383
 
            from . import vfs
 
380
            from bzrlib.smart import vfs
384
381
            if issubclass(command, vfs.VfsRequest):
385
382
                action = 'hpss vfs req'
386
383
            else:
417
414
    elif isinstance(err, errors.ShortReadvError):
418
415
        return ('ShortReadvError', err.path, str(err.offset), str(err.length),
419
416
                str(err.actual))
420
 
    elif isinstance(err, errors.RevisionNotPresent):
421
 
        return ('RevisionNotPresent', err.revision_id, err.file_id)
422
417
    elif isinstance(err, errors.UnstackableRepositoryFormat):
423
418
        return (('UnstackableRepositoryFormat', str(err.format), err.url))
424
419
    elif isinstance(err, errors.UnstackableBranchFormat):
425
420
        return ('UnstackableBranchFormat', str(err.format), err.url)
426
421
    elif isinstance(err, errors.NotStacked):
427
422
        return ('NotStacked',)
428
 
    elif isinstance(err, errors.BzrCheckError):
429
 
        return ('BzrCheckError', err.msg)
430
423
    elif isinstance(err, UnicodeError):
431
424
        # If it is a DecodeError, than most likely we are starting
432
425
        # with a plain string
453
446
        return ('TokenMismatch', err.given_token, err.lock_token)
454
447
    elif isinstance(err, errors.LockContention):
455
448
        return ('LockContention',)
456
 
    elif isinstance(err, MemoryError):
457
 
        # GZ 2011-02-24: Copy breezy.trace -Dmem_dump functionality here?
458
 
        return ('MemoryError',)
459
449
    # Unserialisable error.  Log it, and return a generic error
460
450
    trace.log_exception_quietly()
461
 
    return ('error', trace._qualified_exception_name(err.__class__, True),
462
 
        str(err))
 
451
    return ('error', str(err))
463
452
 
464
453
 
465
454
class HelloRequest(SmartServerRequest):
497
486
        return SuccessfulSmartServerResponse((answer,))
498
487
 
499
488
 
500
 
# In the 'info' attribute, we store whether this request is 'safe' to retry if
501
 
# we get a disconnect while reading the response. It can have the values:
502
 
#   read    This is purely a read request, so retrying it is perfectly ok.
503
 
#   idem    An idempotent write request. Something like 'put' where if you put
504
 
#           the same bytes twice you end up with the same final bytes.
505
 
#   semi    This is a request that isn't strictly idempotent, but doesn't
506
 
#           result in corruption if it is retried. This is for things like
507
 
#           'lock' and 'unlock'. If you call lock, it updates the disk
508
 
#           structure. If you fail to read the response, you won't be able to
509
 
#           use the lock, because you don't have the lock token. Calling lock
510
 
#           again will fail, because the lock is already taken. However, we
511
 
#           can't tell if the server received our request or not. If it didn't,
512
 
#           then retrying the request is fine, as it will actually do what we
513
 
#           want. If it did, we will interrupt the current operation, but we
514
 
#           are no worse off than interrupting the current operation because of
515
 
#           a ConnectionReset.
516
 
#   semivfs Similar to semi, but specific to a Virtual FileSystem request.
517
 
#   stream  This is a request that takes a stream that cannot be restarted if
518
 
#           consumed. This request is 'safe' in that if we determine the
519
 
#           connection is closed before we consume the stream, we can try
520
 
#           again.
521
 
#   mutate  State is updated in a way that replaying that request results in a
522
 
#           different state. For example 'append' writes more bytes to a given
523
 
#           file. If append succeeds, it moves the file pointer.
524
489
request_handlers = registry.Registry()
525
490
request_handlers.register_lazy(
526
 
    'append', 'breezy.smart.vfs', 'AppendRequest', info='mutate')
527
 
request_handlers.register_lazy(
528
 
    'Branch.break_lock', 'breezy.smart.branch',
529
 
    'SmartServerBranchBreakLock', info='idem')
530
 
request_handlers.register_lazy(
531
 
    'Branch.get_config_file', 'breezy.smart.branch',
532
 
    'SmartServerBranchGetConfigFile', info='read')
533
 
request_handlers.register_lazy(
534
 
    'Branch.get_parent', 'breezy.smart.branch', 'SmartServerBranchGetParent',
535
 
    info='read')
536
 
request_handlers.register_lazy(
537
 
    'Branch.put_config_file', 'breezy.smart.branch',
538
 
    'SmartServerBranchPutConfigFile', info='idem')
539
 
request_handlers.register_lazy(
540
 
    'Branch.get_tags_bytes', 'breezy.smart.branch',
541
 
    'SmartServerBranchGetTagsBytes', info='read')
542
 
request_handlers.register_lazy(
543
 
    'Branch.set_tags_bytes', 'breezy.smart.branch',
544
 
    'SmartServerBranchSetTagsBytes', info='idem')
545
 
request_handlers.register_lazy(
546
 
    'Branch.heads_to_fetch', 'breezy.smart.branch',
547
 
    'SmartServerBranchHeadsToFetch', info='read')
548
 
request_handlers.register_lazy(
549
 
    'Branch.get_stacked_on_url', 'breezy.smart.branch',
550
 
    'SmartServerBranchRequestGetStackedOnURL', info='read')
551
 
request_handlers.register_lazy(
552
 
    'Branch.get_physical_lock_status', 'breezy.smart.branch',
553
 
    'SmartServerBranchRequestGetPhysicalLockStatus', info='read')
554
 
request_handlers.register_lazy(
555
 
    'Branch.last_revision_info', 'breezy.smart.branch',
556
 
    'SmartServerBranchRequestLastRevisionInfo', info='read')
557
 
request_handlers.register_lazy(
558
 
    'Branch.lock_write', 'breezy.smart.branch',
559
 
    'SmartServerBranchRequestLockWrite', info='semi')
560
 
request_handlers.register_lazy(
561
 
    'Branch.revision_history', 'breezy.smart.branch',
562
 
    'SmartServerRequestRevisionHistory', info='read')
563
 
request_handlers.register_lazy(
564
 
    'Branch.set_config_option', 'breezy.smart.branch',
565
 
    'SmartServerBranchRequestSetConfigOption', info='idem')
566
 
request_handlers.register_lazy(
567
 
    'Branch.set_config_option_dict', 'breezy.smart.branch',
568
 
    'SmartServerBranchRequestSetConfigOptionDict', info='idem')
569
 
request_handlers.register_lazy(
570
 
    'Branch.set_last_revision', 'breezy.smart.branch',
571
 
    'SmartServerBranchRequestSetLastRevision', info='idem')
572
 
request_handlers.register_lazy(
573
 
    'Branch.set_last_revision_info', 'breezy.smart.branch',
574
 
    'SmartServerBranchRequestSetLastRevisionInfo', info='idem')
575
 
request_handlers.register_lazy(
576
 
    'Branch.set_last_revision_ex', 'breezy.smart.branch',
577
 
    'SmartServerBranchRequestSetLastRevisionEx', info='idem')
578
 
request_handlers.register_lazy(
579
 
    'Branch.set_parent_location', 'breezy.smart.branch',
580
 
    'SmartServerBranchRequestSetParentLocation', info='idem')
581
 
request_handlers.register_lazy(
582
 
    'Branch.unlock', 'breezy.smart.branch',
583
 
    'SmartServerBranchRequestUnlock', info='semi')
584
 
request_handlers.register_lazy(
585
 
    'Branch.revision_id_to_revno', 'breezy.smart.branch',
586
 
    'SmartServerBranchRequestRevisionIdToRevno', info='read')
587
 
request_handlers.register_lazy(
588
 
    'BzrDir.checkout_metadir', 'breezy.smart.bzrdir',
589
 
    'SmartServerBzrDirRequestCheckoutMetaDir', info='read')
590
 
request_handlers.register_lazy(
591
 
    'BzrDir.cloning_metadir', 'breezy.smart.bzrdir',
592
 
    'SmartServerBzrDirRequestCloningMetaDir', info='read')
593
 
request_handlers.register_lazy(
594
 
    'BzrDir.create_branch', 'breezy.smart.bzrdir',
595
 
    'SmartServerRequestCreateBranch', info='semi')
596
 
request_handlers.register_lazy(
597
 
    'BzrDir.create_repository', 'breezy.smart.bzrdir',
598
 
    'SmartServerRequestCreateRepository', info='semi')
599
 
request_handlers.register_lazy(
600
 
    'BzrDir.find_repository', 'breezy.smart.bzrdir',
601
 
    'SmartServerRequestFindRepositoryV1', info='read')
602
 
request_handlers.register_lazy(
603
 
    'BzrDir.find_repositoryV2', 'breezy.smart.bzrdir',
604
 
    'SmartServerRequestFindRepositoryV2', info='read')
605
 
request_handlers.register_lazy(
606
 
    'BzrDir.find_repositoryV3', 'breezy.smart.bzrdir',
607
 
    'SmartServerRequestFindRepositoryV3', info='read')
608
 
request_handlers.register_lazy(
609
 
    'BzrDir.get_branches', 'breezy.smart.bzrdir',
610
 
    'SmartServerBzrDirRequestGetBranches', info='read')
611
 
request_handlers.register_lazy(
612
 
    'BzrDir.get_config_file', 'breezy.smart.bzrdir',
613
 
    'SmartServerBzrDirRequestConfigFile', info='read')
614
 
request_handlers.register_lazy(
615
 
    'BzrDir.destroy_branch', 'breezy.smart.bzrdir',
616
 
    'SmartServerBzrDirRequestDestroyBranch', info='semi')
617
 
request_handlers.register_lazy(
618
 
    'BzrDir.destroy_repository', 'breezy.smart.bzrdir',
619
 
    'SmartServerBzrDirRequestDestroyRepository', info='semi')
620
 
request_handlers.register_lazy(
621
 
    'BzrDir.has_workingtree', 'breezy.smart.bzrdir',
622
 
    'SmartServerBzrDirRequestHasWorkingTree', info='read')
623
 
request_handlers.register_lazy(
624
 
    'BzrDirFormat.initialize', 'breezy.smart.bzrdir',
625
 
    'SmartServerRequestInitializeBzrDir', info='semi')
626
 
request_handlers.register_lazy(
627
 
    'BzrDirFormat.initialize_ex_1.16', 'breezy.smart.bzrdir',
628
 
    'SmartServerRequestBzrDirInitializeEx', info='semi')
629
 
request_handlers.register_lazy(
630
 
    'BzrDir.open', 'breezy.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
631
 
    info='read')
632
 
request_handlers.register_lazy(
633
 
    'BzrDir.open_2.1', 'breezy.smart.bzrdir',
634
 
    'SmartServerRequestOpenBzrDir_2_1', info='read')
635
 
request_handlers.register_lazy(
636
 
    'BzrDir.open_branch', 'breezy.smart.bzrdir',
637
 
    'SmartServerRequestOpenBranch', info='read')
638
 
request_handlers.register_lazy(
639
 
    'BzrDir.open_branchV2', 'breezy.smart.bzrdir',
640
 
    'SmartServerRequestOpenBranchV2', info='read')
641
 
request_handlers.register_lazy(
642
 
    'BzrDir.open_branchV3', 'breezy.smart.bzrdir',
643
 
    'SmartServerRequestOpenBranchV3', info='read')
644
 
request_handlers.register_lazy(
645
 
    'delete', 'breezy.smart.vfs', 'DeleteRequest', info='semivfs')
646
 
request_handlers.register_lazy(
647
 
    'get', 'breezy.smart.vfs', 'GetRequest', info='read')
648
 
request_handlers.register_lazy(
649
 
    'get_bundle', 'breezy.smart.request', 'GetBundleRequest', info='read')
650
 
request_handlers.register_lazy(
651
 
    'has', 'breezy.smart.vfs', 'HasRequest', info='read')
652
 
request_handlers.register_lazy(
653
 
    'hello', 'breezy.smart.request', 'HelloRequest', info='read')
654
 
request_handlers.register_lazy(
655
 
    'iter_files_recursive', 'breezy.smart.vfs', 'IterFilesRecursiveRequest',
656
 
    info='read')
657
 
request_handlers.register_lazy(
658
 
    'list_dir', 'breezy.smart.vfs', 'ListDirRequest', info='read')
659
 
request_handlers.register_lazy(
660
 
    'mkdir', 'breezy.smart.vfs', 'MkdirRequest', info='semivfs')
661
 
request_handlers.register_lazy(
662
 
    'move', 'breezy.smart.vfs', 'MoveRequest', info='semivfs')
663
 
request_handlers.register_lazy(
664
 
    'put', 'breezy.smart.vfs', 'PutRequest', info='idem')
665
 
request_handlers.register_lazy(
666
 
    'put_non_atomic', 'breezy.smart.vfs', 'PutNonAtomicRequest', info='idem')
667
 
request_handlers.register_lazy(
668
 
    'readv', 'breezy.smart.vfs', 'ReadvRequest', info='read')
669
 
request_handlers.register_lazy(
670
 
    'rename', 'breezy.smart.vfs', 'RenameRequest', info='semivfs')
671
 
request_handlers.register_lazy(
672
 
    'Repository.add_signature_text', 'breezy.smart.repository',
673
 
    'SmartServerRepositoryAddSignatureText', info='idem')
674
 
request_handlers.register_lazy(
675
 
    'Repository.all_revision_ids', 'breezy.smart.repository',
676
 
    'SmartServerRepositoryAllRevisionIds', info='read')
677
 
request_handlers.register_lazy(
678
 
    'PackRepository.autopack', 'breezy.smart.packrepository',
679
 
    'SmartServerPackRepositoryAutopack', info='idem')
680
 
request_handlers.register_lazy(
681
 
    'Repository.break_lock', 'breezy.smart.repository',
682
 
    'SmartServerRepositoryBreakLock', info='idem')
683
 
request_handlers.register_lazy(
684
 
    'Repository.gather_stats', 'breezy.smart.repository',
685
 
    'SmartServerRepositoryGatherStats', info='read')
686
 
request_handlers.register_lazy(
687
 
    'Repository.get_parent_map', 'breezy.smart.repository',
688
 
    'SmartServerRepositoryGetParentMap', info='read')
689
 
request_handlers.register_lazy(
690
 
    'Repository.get_revision_graph', 'breezy.smart.repository',
691
 
    'SmartServerRepositoryGetRevisionGraph', info='read')
692
 
request_handlers.register_lazy(
693
 
    'Repository.get_revision_signature_text', 'breezy.smart.repository',
694
 
    'SmartServerRepositoryGetRevisionSignatureText', info='read')
695
 
request_handlers.register_lazy(
696
 
    'Repository.has_revision', 'breezy.smart.repository',
697
 
    'SmartServerRequestHasRevision', info='read')
698
 
request_handlers.register_lazy(
699
 
    'Repository.has_signature_for_revision_id', 'breezy.smart.repository',
700
 
    'SmartServerRequestHasSignatureForRevisionId', info='read')
701
 
request_handlers.register_lazy(
702
 
    'Repository.insert_stream', 'breezy.smart.repository',
703
 
    'SmartServerRepositoryInsertStream', info='stream')
704
 
request_handlers.register_lazy(
705
 
    'Repository.insert_stream_1.19', 'breezy.smart.repository',
706
 
    'SmartServerRepositoryInsertStream_1_19', info='stream')
707
 
request_handlers.register_lazy(
708
 
    'Repository.insert_stream_locked', 'breezy.smart.repository',
709
 
    'SmartServerRepositoryInsertStreamLocked', info='stream')
710
 
request_handlers.register_lazy(
711
 
    'Repository.is_shared', 'breezy.smart.repository',
712
 
    'SmartServerRepositoryIsShared', info='read')
713
 
request_handlers.register_lazy(
714
 
    'Repository.iter_files_bytes', 'breezy.smart.repository',
715
 
    'SmartServerRepositoryIterFilesBytes', info='read')
716
 
request_handlers.register_lazy(
717
 
    'Repository.lock_write', 'breezy.smart.repository',
718
 
    'SmartServerRepositoryLockWrite', info='semi')
719
 
request_handlers.register_lazy(
720
 
    'Repository.make_working_trees', 'breezy.smart.repository',
721
 
    'SmartServerRepositoryMakeWorkingTrees', info='read')
722
 
request_handlers.register_lazy(
723
 
    'Repository.set_make_working_trees', 'breezy.smart.repository',
724
 
    'SmartServerRepositorySetMakeWorkingTrees', info='idem')
725
 
request_handlers.register_lazy(
726
 
    'Repository.unlock', 'breezy.smart.repository',
727
 
    'SmartServerRepositoryUnlock', info='semi')
728
 
request_handlers.register_lazy(
729
 
    'Repository.get_physical_lock_status', 'breezy.smart.repository',
730
 
    'SmartServerRepositoryGetPhysicalLockStatus', info='read')
731
 
request_handlers.register_lazy(
732
 
    'Repository.get_rev_id_for_revno', 'breezy.smart.repository',
733
 
    'SmartServerRepositoryGetRevIdForRevno', info='read')
734
 
request_handlers.register_lazy(
735
 
    'Repository.get_stream', 'breezy.smart.repository',
736
 
    'SmartServerRepositoryGetStream', info='read')
737
 
request_handlers.register_lazy(
738
 
    'Repository.get_stream_1.19', 'breezy.smart.repository',
739
 
    'SmartServerRepositoryGetStream_1_19', info='read')
740
 
request_handlers.register_lazy(
741
 
    'Repository.iter_revisions', 'breezy.smart.repository',
742
 
    'SmartServerRepositoryIterRevisions', info='read')
743
 
request_handlers.register_lazy(
744
 
    'Repository.pack', 'breezy.smart.repository',
745
 
    'SmartServerRepositoryPack', info='idem')
746
 
request_handlers.register_lazy(
747
 
    'Repository.start_write_group', 'breezy.smart.repository',
748
 
    'SmartServerRepositoryStartWriteGroup', info='semi')
749
 
request_handlers.register_lazy(
750
 
    'Repository.commit_write_group', 'breezy.smart.repository',
751
 
    'SmartServerRepositoryCommitWriteGroup', info='semi')
752
 
request_handlers.register_lazy(
753
 
    'Repository.abort_write_group', 'breezy.smart.repository',
754
 
    'SmartServerRepositoryAbortWriteGroup', info='semi')
755
 
request_handlers.register_lazy(
756
 
    'Repository.check_write_group', 'breezy.smart.repository',
757
 
    'SmartServerRepositoryCheckWriteGroup', info='read')
758
 
request_handlers.register_lazy(
759
 
    'Repository.reconcile', 'breezy.smart.repository',
760
 
    'SmartServerRepositoryReconcile', info='idem')
761
 
request_handlers.register_lazy(
762
 
    'Repository.tarball', 'breezy.smart.repository',
763
 
    'SmartServerRepositoryTarball', info='read')
764
 
request_handlers.register_lazy(
765
 
    'VersionedFileRepository.get_serializer_format', 'breezy.smart.repository',
766
 
    'SmartServerRepositoryGetSerializerFormat', info='read')
767
 
request_handlers.register_lazy(
768
 
    'VersionedFileRepository.get_inventories', 'breezy.smart.repository',
769
 
    'SmartServerRepositoryGetInventories', info='read')
770
 
request_handlers.register_lazy(
771
 
    'rmdir', 'breezy.smart.vfs', 'RmdirRequest', info='semivfs')
772
 
request_handlers.register_lazy(
773
 
    'stat', 'breezy.smart.vfs', 'StatRequest', info='read')
774
 
request_handlers.register_lazy(
775
 
    'Transport.is_readonly', 'breezy.smart.request',
776
 
    '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')