~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Andrew Bennetts
  • Date: 2010-08-17 06:45:33 UTC
  • mfrom: (5050.17.9 2.2)
  • mto: This revision was merged to the branch mainline in revision 5379.
  • Revision ID: andrew.bennetts@canonical.com-20100817064533-kof2i2f3r6mr4ayb
Merge lp:bzr/2.2 into lp:bzr, including fixes for #192859, #224373, #300062, #585667, #614404, #617503.

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):
506
501
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
507
502
    'SmartServerBranchSetTagsBytes')
508
503
request_handlers.register_lazy(
509
 
    'Branch.heads_to_fetch', 'bzrlib.smart.branch',
510
 
    'SmartServerBranchHeadsToFetch')
511
 
request_handlers.register_lazy(
512
504
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
513
505
request_handlers.register_lazy(
514
506
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')