equal
deleted
inserted
replaced
746 repo.close() |
746 repo.close() |
747 |
747 |
748 def lsprofile(ui, func, fp): |
748 def lsprofile(ui, func, fp): |
749 format = ui.config('profiling', 'format', default='text') |
749 format = ui.config('profiling', 'format', default='text') |
750 field = ui.config('profiling', 'sort', default='inlinetime') |
750 field = ui.config('profiling', 'sort', default='inlinetime') |
|
751 limit = ui.configint('profiling', 'limit', default=30) |
751 climit = ui.configint('profiling', 'nested', default=5) |
752 climit = ui.configint('profiling', 'nested', default=5) |
752 |
753 |
753 if format not in ['text', 'kcachegrind']: |
754 if format not in ['text', 'kcachegrind']: |
754 ui.warn(_("unrecognized profiling format '%s'" |
755 ui.warn(_("unrecognized profiling format '%s'" |
755 " - Ignored\n") % format) |
756 " - Ignored\n") % format) |
774 calltree.output(fp) |
775 calltree.output(fp) |
775 else: |
776 else: |
776 # format == 'text' |
777 # format == 'text' |
777 stats = lsprof.Stats(p.getstats()) |
778 stats = lsprof.Stats(p.getstats()) |
778 stats.sort(field) |
779 stats.sort(field) |
779 stats.pprint(limit=30, file=fp, climit=climit) |
780 stats.pprint(limit=limit, file=fp, climit=climit) |
780 |
781 |
781 def statprofile(ui, func, fp): |
782 def statprofile(ui, func, fp): |
782 try: |
783 try: |
783 import statprof |
784 import statprof |
784 except ImportError: |
785 except ImportError: |