summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
380fde1)
The patch adds the 'exitcode' boolean argument to Run.run() and
modifies the 'log' command.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
from stgit.commands.common import *
from stgit import stack, git
from stgit.out import *
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]
help = 'display the patch changelog'
usage = """%prog [options] [patch]
raise CmdException, 'No changelog for patch "%s"' % name
if options.graphical:
raise CmdException, 'No changelog for patch "%s"' % name
if options.graphical:
- if os.system('gitk %s' % log) != 0:
- raise CmdException, 'gitk execution failed'
+ Run('gitk', log).run(exitcode = False)
else:
show_log(log, options)
else:
show_log(log, options)
self.__log_end(self.exitcode)
self.__check_exitcode()
return outdata
self.__log_end(self.exitcode)
self.__check_exitcode()
return outdata
+ def __run_noio(self, exitcode = True):
"""Run without captured IO."""
assert self.__indata == None
self.__log_start()
"""Run without captured IO."""
assert self.__indata == None
self.__log_start()
except OSError, e:
raise self.exc('%s failed: %s' % (self.__cmd[0], e))
self.__log_end(self.exitcode)
except OSError, e:
raise self.exc('%s failed: %s' % (self.__cmd[0], e))
self.__log_end(self.exitcode)
- self.__check_exitcode()
+ if exitcode:
+ self.__check_exitcode()
def returns(self, retvals):
self.__good_retvals = retvals
return self
def returns(self, retvals):
self.__good_retvals = retvals
return self
else:
raise self.exc('%s produced %d lines, expected 1'
% (self.__cmd[0], len(outlines)))
else:
raise self.exc('%s produced %d lines, expected 1'
% (self.__cmd[0], len(outlines)))
+ def run(self, exitcode = True):
"""Just run, with no IO redirection."""
"""Just run, with no IO redirection."""
+ self.__run_noio(exitcode = exitcode)
def xargs(self, xargs):
"""Just run, with no IO redirection. The extra arguments are
appended to the command line a few at a time; the command is
def xargs(self, xargs):
"""Just run, with no IO redirection. The extra arguments are
appended to the command line a few at a time; the command is