/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:
31
31
# of a SmartServerRequest subclass.
32
32
 
33
33
 
 
34
import tempfile
 
35
import thread
34
36
import threading
35
37
 
36
38
from bzrlib import (
46
48
from bzrlib.lazy_import import lazy_import
47
49
lazy_import(globals(), """
48
50
from bzrlib.bundle import serializer
49
 
 
50
 
import tempfile
51
 
import thread
52
51
""")
53
52
 
54
53
 
135
134
        It will return a SmartServerResponse if the command does not expect a
136
135
        body.
137
136
 
138
 
        :param args: the arguments of the request.
 
137
        :param *args: the arguments of the request.
139
138
        """
140
139
        self._check_enabled()
141
140
        return self.do(*args)
447
446
        return ('TokenMismatch', err.given_token, err.lock_token)
448
447
    elif isinstance(err, errors.LockContention):
449
448
        return ('LockContention',)
450
 
    elif isinstance(err, MemoryError):
451
 
        # GZ 2011-02-24: Copy bzrlib.trace -Dmem_dump functionality here?
452
 
        return ('MemoryError',)
453
449
    # Unserialisable error.  Log it, and return a generic error
454
450
    trace.log_exception_quietly()
455
 
    return ('error', trace._qualified_exception_name(err.__class__, True),
456
 
        str(err))
 
451
    return ('error', str(err))
457
452
 
458
453
 
459
454
class HelloRequest(SmartServerRequest):
498
493
    'Branch.get_config_file', 'bzrlib.smart.branch',
499
494
    'SmartServerBranchGetConfigFile')
500
495
request_handlers.register_lazy(
501
 
    'Branch.put_config_file', 'bzrlib.smart.branch',
502
 
    'SmartServerBranchPutConfigFile')
503
 
request_handlers.register_lazy(
504
496
    'Branch.get_parent', 'bzrlib.smart.branch', 'SmartServerBranchGetParent')
505
497
request_handlers.register_lazy(
506
498
    'Branch.get_tags_bytes', 'bzrlib.smart.branch',
509
501
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
510
502
    'SmartServerBranchSetTagsBytes')
511
503
request_handlers.register_lazy(
512
 
    'Branch.heads_to_fetch', 'bzrlib.smart.branch',
513
 
    'SmartServerBranchHeadsToFetch')
514
 
request_handlers.register_lazy(
515
504
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
516
505
request_handlers.register_lazy(
517
506
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
521
510
    'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory')
522
511
request_handlers.register_lazy( 'Branch.set_config_option',
523
512
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOption')
524
 
request_handlers.register_lazy( 'Branch.set_config_option_dict',
525
 
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOptionDict')
526
513
request_handlers.register_lazy( 'Branch.set_last_revision',
527
514
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
528
515
request_handlers.register_lazy(
558
545
    'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
559
546
    'SmartServerBzrDirRequestConfigFile')
560
547
request_handlers.register_lazy(
561
 
    'BzrDir.has_workingtree', 'bzrlib.smart.bzrdir',
562
 
    'SmartServerBzrDirRequestHasWorkingTree')
563
 
request_handlers.register_lazy(
564
 
    'BzrDir.destroy_repository', 'bzrlib.smart.bzrdir',
565
 
    'SmartServerBzrDirRequestDestroyRepository')
566
 
request_handlers.register_lazy(
567
548
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
568
549
    'SmartServerRequestInitializeBzrDir')
569
550
request_handlers.register_lazy(
622
603
request_handlers.register_lazy(
623
604
    'Repository.has_revision', 'bzrlib.smart.repository', 'SmartServerRequestHasRevision')
624
605
request_handlers.register_lazy(
625
 
    'Repository.has_signature_for_revision_id', 'bzrlib.smart.repository',
626
 
    'SmartServerRequestHasSignatureForRevisionId')
627
 
request_handlers.register_lazy(
628
606
    'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
629
607
request_handlers.register_lazy(
630
608
    'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
635
613
request_handlers.register_lazy(
636
614
    'Repository.lock_write', 'bzrlib.smart.repository', 'SmartServerRepositoryLockWrite')
637
615
request_handlers.register_lazy(
638
 
    'Repository.make_working_trees', 'bzrlib.smart.repository', 'SmartServerRepositoryMakeWorkingTrees')
639
 
request_handlers.register_lazy(
640
616
    'Repository.set_make_working_trees', 'bzrlib.smart.repository',
641
617
    'SmartServerRepositorySetMakeWorkingTrees')
642
618
request_handlers.register_lazy(