~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: John Arbash Meinel
  • Date: 2010-11-05 20:54:32 UTC
  • mfrom: (5526 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5527.
  • Revision ID: john@arbash-meinel.com-20101105205432-rmyozu8sthyhmri8
Merge bzr.dev to resolve bzr-2.3.txt (aka NEWS)

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