mercurial-crew-mq-inotify / byebyehotshot

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 --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3005,7 +3005,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 --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -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 --git a/tests/test-debugcomplete.out b/tests/test-debugcomplete.out
--- a/tests/test-debugcomplete.out
+++ b/tests/test-debugcomplete.out
@@ -97,7 +97,6 @@
 --encoding
 --encodingmode
 --help
---lsprof
 --noninteractive
 --profile
 --quiet
@@ -127,7 +126,6 @@
 --errorlog
 --help
 --ipv6
---lsprof
 --name
 --noninteractive
 --pid-file
diff --git a/tests/test-extension.out b/tests/test-extension.out
--- a/tests/test-extension.out
+++ b/tests/test-extension.out
@@ -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 --git a/tests/test-profile b/tests/test-profile
--- a/tests/test-profile
+++ b/tests/test-profile
@@ -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 --git a/tests/test-profile.out b/tests/test-profile.out
--- a/tests/test-profile.out
+++ b/tests/test-profile.out
@@ -1,3 +1,2 @@
 % test --time
 % test --profile
-% test --lsprof
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.