/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: Vincent Ladeuil
  • Date: 2011-11-24 15:48:29 UTC
  • mfrom: (6289 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6337.
  • Revision ID: v.ladeuil+lp@free.fr-20111124154829-avowjpsxdl8yp2vz
merge trunk resolving conflicts

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