##// END OF EJS Templates
profiling: dropping hotshot profiling. --profile as a unique profiling option...
Nicolas Dumazet -
r8021:1c2cf2e5 default
parent child Browse files
Show More
@@ -3000,7 +3000,6 b' globalopts = ['
3000 ('', 'encoding', encoding.encoding, _('set the charset encoding')),
3000 ('', 'encoding', encoding.encoding, _('set the charset encoding')),
3001 ('', 'encodingmode', encoding.encodingmode,
3001 ('', 'encodingmode', encoding.encodingmode,
3002 _('set the charset encoding mode')),
3002 _('set the charset encoding mode')),
3003 ('', 'lsprof', None, _('print improved command execution profile')),
3004 ('', 'traceback', None, _('print traceback on exception')),
3003 ('', 'traceback', None, _('print traceback on exception')),
3005 ('', 'time', None, _('time how long the command takes')),
3004 ('', 'time', None, _('time how long the command takes')),
3006 ('', 'profile', None, _('print command execution profile')),
3005 ('', 'profile', None, _('print command execution profile')),
@@ -379,25 +379,6 b' def _runcommand(ui, options, cmd, cmdfun'
379 raise error.ParseError(cmd, _("invalid arguments"))
379 raise error.ParseError(cmd, _("invalid arguments"))
380
380
381 if options['profile']:
381 if options['profile']:
382 import hotshot, hotshot.stats
383 prof = hotshot.Profile("hg.prof")
384 try:
385 try:
386 return prof.runcall(checkargs)
387 except:
388 try:
389 ui.warn(_('exception raised - generating '
390 'profile anyway\n'))
391 except:
392 pass
393 raise
394 finally:
395 prof.close()
396 stats = hotshot.stats.load("hg.prof")
397 stats.strip_dirs()
398 stats.sort_stats('time', 'calls')
399 stats.print_stats(40)
400 elif options['lsprof']:
401 try:
382 try:
402 from mercurial import lsprof
383 from mercurial import lsprof
403 except ImportError:
384 except ImportError:
@@ -97,7 +97,6 b' rawcommit'
97 --encoding
97 --encoding
98 --encodingmode
98 --encodingmode
99 --help
99 --help
100 --lsprof
101 --noninteractive
100 --noninteractive
102 --profile
101 --profile
103 --quiet
102 --quiet
@@ -127,7 +126,6 b' rawcommit'
127 --errorlog
126 --errorlog
128 --help
127 --help
129 --ipv6
128 --ipv6
130 --lsprof
131 --name
129 --name
132 --noninteractive
130 --noninteractive
133 --pid-file
131 --pid-file
@@ -48,7 +48,6 b' global options:'
48 --debugger start debugger
48 --debugger start debugger
49 --encoding set the charset encoding (default: ascii)
49 --encoding set the charset encoding (default: ascii)
50 --encodingmode set the charset encoding mode (default: strict)
50 --encodingmode set the charset encoding mode (default: strict)
51 --lsprof print improved command execution profile
52 --traceback print traceback on exception
51 --traceback print traceback on exception
53 --time time how long the command takes
52 --time time how long the command takes
54 --profile print command execution profile
53 --profile print command execution profile
@@ -4,12 +4,6 b' echo % test --time'
4 hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed
4 hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed
5
5
6 echo % test --profile
6 echo % test --profile
7 if "$TESTDIR/hghave" -q hotshot; then
7 if "$TESTDIR/hghave" -q lsprof; then
8 # hotshot might be missing for licensing issues
8 hg --profile help -q help 2>&1 | grep CallCount > /dev/null || echo --profile failed
9 hg --profile help -q help 2>&1 | grep ncalls > /dev/null || echo --profile failed
10 fi
9 fi
11
12 echo % test --lsprof
13 if "$TESTDIR/hghave" -q lsprof; then
14 hg --lsprof help -q help 2>&1 | grep CallCount > /dev/null || echo --lsprof failed
15 fi
@@ -1,3 +1,2 b''
1 % test --time
1 % test --time
2 % test --profile
2 % test --profile
3 % test --lsprof
General Comments 0
You need to be logged in to leave comments. Login now