Allow only certain gitk exit codes as valid
[stgit] / stgit / commands / log.py
index 39c2118..52d55a5 100644 (file)
@@ -21,6 +21,7 @@ from pydoc import pager
 from stgit.commands.common import *
 from stgit import stack, git
 from stgit.out import *
+from stgit.run import Run
 
 help = 'display the patch changelog'
 usage = """%prog [options] [patch]
@@ -140,7 +141,7 @@ def func(parser, options, args):
         raise CmdException, 'No changelog for patch "%s"' % name
 
     if options.graphical:
-        if os.system('gitk %s' % log) != 0:
-            raise CmdException, 'gitk execution failed'
+        # discard the exit codes generated by SIGINT, SIGKILL, SIGTERM
+        Run('gitk', log).returns([0, -2, -9, -15]).run()
     else:
         show_log(log, options)