changeset 8802:ca14b3982ffe

bisect: fix traceback when command executable is not found
author Patrick Mezard <pmezard@gmail.com>
date Sat, 13 Jun 2009 22:42:13 +0200
parents 1c610db4a897
children 2b35ced86b69
files mercurial/commands.py tests/test-bisect tests/test-bisect.out
diffstat 3 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat May 23 20:38:08 2009 +0900
+++ b/mercurial/commands.py	Sat Jun 13 22:42:13 2009 +0200
@@ -339,6 +339,8 @@
 
     if command:
         commandpath = util.find_exe(command)
+        if commandpath is None:
+            raise util.Abort(_("cannot find executable: %s") % command)
         changesets = 1
         try:
             while changesets:
--- a/tests/test-bisect	Sat May 23 20:38:08 2009 +0900
+++ b/tests/test-bisect	Sat Jun 13 22:42:13 2009 +0200
@@ -82,3 +82,7 @@
 hg bisect -s
 hg bisect -s 
 hg bisect -g
+
+echo % test invalid command
+hg bisect -r
+hg bisect --command 'foobar'
--- a/tests/test-bisect.out	Sat May 23 20:38:08 2009 +0900
+++ b/tests/test-bisect.out	Sat Jun 13 22:42:13 2009 +0200
@@ -303,3 +303,5 @@
 date:        Thu Jan 01 00:00:06 1970 +0000
 summary:     msg 6
 
+% test invalid command
+abort: cannot find executable: foobar