# HG changeset patch # User Nicolas Dumazet # Date 1239193100 -7200 # Node ID 1c2cf2e5dc9b99d1eb24b6a63fbd5d5effc6cd76 # Parent 777a9efdae2d291b446c5abb4c95c0f0e73462a6 profiling: dropping hotshot profiling. --profile as a unique profiling option hotshot was an experimental module, which is broken for Python < 2.5 And even for Python >= 2.5 users, hotshot usage is discouraged: cProfile (formerly lsprof) should be used instead. diff -r 777a9efdae2d -r 1c2cf2e5dc9b mercurial/commands.py --- a/mercurial/commands.py Tue Apr 07 20:57:25 2009 +0200 +++ b/mercurial/commands.py Wed Apr 08 14:18:20 2009 +0200 @@ -3000,7 +3000,6 @@ ('', 'encoding', encoding.encoding, _('set the charset encoding')), ('', 'encodingmode', encoding.encodingmode, _('set the charset encoding mode')), - ('', 'lsprof', None, _('print improved command execution profile')), ('', 'traceback', None, _('print traceback on exception')), ('', 'time', None, _('time how long the command takes')), ('', 'profile', None, _('print command execution profile')), diff -r 777a9efdae2d -r 1c2cf2e5dc9b mercurial/dispatch.py --- a/mercurial/dispatch.py Tue Apr 07 20:57:25 2009 +0200 +++ b/mercurial/dispatch.py Wed Apr 08 14:18:20 2009 +0200 @@ -379,25 +379,6 @@ raise error.ParseError(cmd, _("invalid arguments")) if options['profile']: - import hotshot, hotshot.stats - prof = hotshot.Profile("hg.prof") - try: - try: - return prof.runcall(checkargs) - except: - try: - ui.warn(_('exception raised - generating ' - 'profile anyway\n')) - except: - pass - raise - finally: - prof.close() - stats = hotshot.stats.load("hg.prof") - stats.strip_dirs() - stats.sort_stats('time', 'calls') - stats.print_stats(40) - elif options['lsprof']: try: from mercurial import lsprof except ImportError: diff -r 777a9efdae2d -r 1c2cf2e5dc9b tests/test-debugcomplete.out --- a/tests/test-debugcomplete.out Tue Apr 07 20:57:25 2009 +0200 +++ b/tests/test-debugcomplete.out Wed Apr 08 14:18:20 2009 +0200 @@ -97,7 +97,6 @@ --encoding --encodingmode --help ---lsprof --noninteractive --profile --quiet @@ -127,7 +126,6 @@ --errorlog --help --ipv6 ---lsprof --name --noninteractive --pid-file diff -r 777a9efdae2d -r 1c2cf2e5dc9b tests/test-extension.out --- a/tests/test-extension.out Tue Apr 07 20:57:25 2009 +0200 +++ b/tests/test-extension.out Wed Apr 08 14:18:20 2009 +0200 @@ -48,7 +48,6 @@ --debugger start debugger --encoding set the charset encoding (default: ascii) --encodingmode set the charset encoding mode (default: strict) - --lsprof print improved command execution profile --traceback print traceback on exception --time time how long the command takes --profile print command execution profile diff -r 777a9efdae2d -r 1c2cf2e5dc9b tests/test-profile --- a/tests/test-profile Tue Apr 07 20:57:25 2009 +0200 +++ b/tests/test-profile Wed Apr 08 14:18:20 2009 +0200 @@ -4,12 +4,6 @@ hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed echo % test --profile -if "$TESTDIR/hghave" -q hotshot; then - # hotshot might be missing for licensing issues - hg --profile help -q help 2>&1 | grep ncalls > /dev/null || echo --profile failed +if "$TESTDIR/hghave" -q lsprof; then + hg --profile help -q help 2>&1 | grep CallCount > /dev/null || echo --profile failed fi - -echo % test --lsprof -if "$TESTDIR/hghave" -q lsprof; then - hg --lsprof help -q help 2>&1 | grep CallCount > /dev/null || echo --lsprof failed -fi diff -r 777a9efdae2d -r 1c2cf2e5dc9b tests/test-profile.out --- a/tests/test-profile.out Tue Apr 07 20:57:25 2009 +0200 +++ b/tests/test-profile.out Wed Apr 08 14:18:20 2009 +0200 @@ -1,3 +1,2 @@ % test --time % test --profile -% test --lsprof