~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2007-06-28 02:43:50 UTC
  • mfrom: (2553 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2558.
  • Revision ID: robertc@robertcollins.net-20070628024350-z8bdm0y6yz2uyf4o
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
534
534
 
535
535
def apply_lsprofiled(filename, the_callable, *args, **kwargs):
536
536
    from bzrlib.lsprof import profile
537
 
    import cPickle
538
537
    ret, stats = profile(the_callable, *args, **kwargs)
539
538
    stats.sort()
540
539
    if filename is None:
541
540
        stats.pprint()
542
541
    else:
543
542
        stats.save(filename)
544
 
        print 'Profile data written to %r.' % filename
 
543
        trace.note('Profile data written to "%s".', filename)
545
544
    return ret
546
545
 
547
546
 
713
712
 
714
713
def run_bzr_catch_errors(argv):
715
714
    try:
716
 
        try:
717
 
            return run_bzr(argv)
718
 
        finally:
719
 
            # do this here inside the exception wrappers to catch EPIPE
720
 
            sys.stdout.flush()
 
715
        return run_bzr(argv)
721
716
    except (KeyboardInterrupt, Exception), e:
722
717
        # used to handle AssertionError and KeyboardInterrupt
723
718
        # specially here, but hopefully they're handled ok by the logger now