/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

Implement RemoteRepository side of write group HPSS methods.

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):
501
506
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
502
507
    'SmartServerBranchSetTagsBytes')
503
508
request_handlers.register_lazy(
 
509
    'Branch.heads_to_fetch', 'bzrlib.smart.branch',
 
510
    'SmartServerBranchHeadsToFetch')
 
511
request_handlers.register_lazy(
504
512
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
505
513
request_handlers.register_lazy(
506
514
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
510
518
    'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory')
511
519
request_handlers.register_lazy( 'Branch.set_config_option',
512
520
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOption')
 
521
request_handlers.register_lazy( 'Branch.set_config_option_dict',
 
522
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOptionDict')
513
523
request_handlers.register_lazy( 'Branch.set_last_revision',
514
524
    'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
515
525
request_handlers.register_lazy(
545
555
    'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
546
556
    'SmartServerBzrDirRequestConfigFile')
547
557
request_handlers.register_lazy(
 
558
    'BzrDir.has_workingtree', 'bzrlib.smart.bzrdir',
 
559
    'SmartServerBzrDirRequestHasWorkingTree')
 
560
request_handlers.register_lazy(
 
561
    'BzrDir.destroy_repository', 'bzrlib.smart.bzrdir',
 
562
    'SmartServerBzrDirRequestDestroyRepository')
 
563
request_handlers.register_lazy(
548
564
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
549
565
    'SmartServerRequestInitializeBzrDir')
550
566
request_handlers.register_lazy(
603
619
request_handlers.register_lazy(
604
620
    'Repository.has_revision', 'bzrlib.smart.repository', 'SmartServerRequestHasRevision')
605
621
request_handlers.register_lazy(
 
622
    'Repository.has_signature_for_revision_id', 'bzrlib.smart.repository',
 
623
    'SmartServerRequestHasSignatureForRevisionId')
 
624
request_handlers.register_lazy(
606
625
    'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
607
626
request_handlers.register_lazy(
608
627
    'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
613
632
request_handlers.register_lazy(
614
633
    'Repository.lock_write', 'bzrlib.smart.repository', 'SmartServerRepositoryLockWrite')
615
634
request_handlers.register_lazy(
 
635
    'Repository.make_working_trees', 'bzrlib.smart.repository', 'SmartServerRepositoryMakeWorkingTrees')
 
636
request_handlers.register_lazy(
616
637
    'Repository.set_make_working_trees', 'bzrlib.smart.repository',
617
638
    'SmartServerRepositorySetMakeWorkingTrees')
618
639
request_handlers.register_lazy(