chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4646e7a
)
Stop the e-mail sending if editor fails
author
Catalin Marinas
<catalin.marinas@gmail.com>
Mon, 5 Feb 2007 22:41:41 +0000
(22:41 +0000)
committer
Catalin Marinas
<catalin.marinas@gmail.com>
Mon, 5 Feb 2007 22:41:41 +0000
(22:41 +0000)
With this patch, if the editor exits with a non-zero status, stop
sending any e-mails.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/mail.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/commands/mail.py
b/stgit/commands/mail.py
index 7f20f13760cd273ecaa66ac0219ff04a01563d79..cf470f146fd6e2e75d30bf64bdd99eabec99bb74 100644
(file)
--- a/
stgit/commands/mail.py
+++ b/
stgit/commands/mail.py
@@
-290,7
+290,10
@@
def __edit_message(msg):
print 'Invoking the editor: "%s"...' % editor,
sys.stdout.flush()
- print 'done (exit code: %d)' % os.system(editor)
+ err = os.system(editor)
+ if err:
+ raise CmdException, 'editor failed, exit code: %d' % err
+ print 'done'
# read the message back
f = file(fname)