diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-21 11:44:27 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-21 16:06:08 +0100 |
commit | 0513d8ebcd7bff35d602719364374b71b152efd5 (patch) | |
tree | 4556de03bf204f3e8ed46b8229a0bdc77070b3ba /morphlib | |
parent | 95c8eb1b7103c3ae3b1a461022c549fc583b0071 (diff) | |
download | morph-0513d8ebcd7bff35d602719364374b71b152efd5.tar.gz |
morph foreach: Fix with cliapp < 1.20120630
Use cliapp.Application.runcmd_unchecked() instead of runcmd() to get
the full command output, without requiring AppException.msg (which is
an inferior way to get the output in any case)
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index e2c7ef84..cf54e2e4 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -982,13 +982,9 @@ class BranchAndMergePlugin(cliapp.Plugin): self.app.output.write('\n') self.app.output.write('%s\n' % repo) - try: - output = self.app.runcmd(args, cwd=d) - except cliapp.AppException as e: - # Don't allow cliapp to swallow the output of the command - # as the body of the exception - output_start = e.msg.find('\n') - self.app.output.write(e.msg[output_start+1:]) - raise cliapp.AppException(e.msg[:output_start]) - + status, output, error = self.app.runcmd_unchecked(args, cwd=d) self.app.output.write(output) + if status != 0: + self.app.output.write(error) + raise cliapp.AppException( + 'Command failed at repo %s: %s' % (repo, ' '.join(args))) |