~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Jelmer Vernooij
  • Date: 2011-02-21 15:09:19 UTC
  • mto: This revision was merged to the branch mainline in revision 5675.
  • Revision ID: jelmer@samba.org-20110221150919-v7nnbontcuhi1dmu
Move Repository._find_text_key_references_from_xml_inventory_lines onto the serializer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
59
59
import os
60
60
import sys
61
61
import time
 
62
import tempfile
62
63
 
63
64
from bzrlib.lazy_import import lazy_import
64
65
lazy_import(globals(), """
65
66
from cStringIO import StringIO
66
67
import errno
67
68
import locale
68
 
import tempfile
69
69
import traceback
70
70
""")
71
71
 
81
81
    debug,
82
82
    errors,
83
83
    osutils,
 
84
    plugin,
 
85
    symbol_versioning,
84
86
    ui,
85
87
    )
86
88
""")
486
488
        elif fd is not None:
487
489
            os.close(fd)
488
490
 
489
 
 
490
 
def _qualified_exception_name(eclass, unqualified_bzrlib_errors=False):
491
 
    """Give name of error class including module for non-builtin exceptions
492
 
 
493
 
    If `unqualified_bzrlib_errors` is True, errors specific to bzrlib will
494
 
    also omit the module prefix.
495
 
    """
496
 
    class_name = eclass.__name__
497
 
    module_name = eclass.__module__
498
 
    if module_name in ("exceptions", "__main__") or (
499
 
            unqualified_bzrlib_errors and module_name == "bzrlib.errors"):
500
 
        return class_name
501
 
    return "%s.%s" % (module_name, class_name)
502
 
 
503
 
 
504
491
def report_exception(exc_info, err_file):
505
492
    """Report an exception to err_file (typically stderr) and to .bzr.log.
506
493