~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-08-02 23:02:14 UTC
  • Revision ID: mbp@sourcefrog.net-20050802230214-749f075e18a73ff8
- if 1 is set, show tracebacks directly on stderr

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# TODO: probably should say which arguments are candidates for glob
21
21
# expansion on windows and do that at the command level.
22
22
 
23
 
import sys, os
 
23
import sys
 
24
import os
24
25
 
25
26
import bzrlib
26
27
from bzrlib.trace import mutter, note, log_error, warning
1823
1824
 
1824
1825
def _report_exception(summary, quiet=False):
1825
1826
    import traceback
 
1827
    
1826
1828
    log_error('bzr: ' + summary)
1827
1829
    bzrlib.trace.log_exception()
1828
1830
 
 
1831
    if os.environ.get('BZR_DEBUG'):
 
1832
        traceback.print_exc()
 
1833
 
1829
1834
    if not quiet:
 
1835
        sys.stderr.write('\n')
1830
1836
        tb = sys.exc_info()[2]
1831
1837
        exinfo = traceback.extract_tb(tb)
1832
1838
        if exinfo: