~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-09 09:54:24 UTC
  • mfrom: (5840.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20110509095424-go6263smv6wzc5u1
(vila) Use a proper version for the weave_format plugin (Vincent
 Ladeuil)

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
 
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')