chiark
/
gitweb
/
~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Edit the cover or patch message before e-mail encoding
[stgit]
/
stgit
/
commands
/
mail.py
diff --git
a/stgit/commands/mail.py
b/stgit/commands/mail.py
index 7875fac9b7db87a05686e218a2d8f85ae54833ee..31cc48ac90672fe26607f35c42f3f7a39c061a79 100644
(file)
--- a/
stgit/commands/mail.py
+++ b/
stgit/commands/mail.py
@@
-265,7
+265,7
@@
def __encode_message(msg):
# encode the body and set the MIME and encoding headers
msg.set_charset(charset)
# encode the body and set the MIME and encoding headers
msg.set_charset(charset)
-def edit_message(msg):
+def
__
edit_message(msg):
fname = '.stgitmail.txt'
# create the initial file
fname = '.stgitmail.txt'
# create the initial file
@@
-337,6
+337,9
@@
def __build_cover(tmpl, total_nr, msg_id, options):
raise CmdException, 'Only "%(name)s" variables are ' \
'supported in the patch template'
raise CmdException, 'Only "%(name)s" variables are ' \
'supported in the patch template'
+ if options.edit_cover:
+ msg_string = __edit_message(msg_string)
+
# The Python email message
try:
msg = email.message_from_string(msg_string)
# The Python email message
try:
msg = email.message_from_string(msg_string)
@@
-349,9
+352,6
@@
def __build_cover(tmpl, total_nr, msg_id, options):
msg_string = msg.as_string(options.mbox)
msg_string = msg.as_string(options.mbox)
- if options.edit_cover:
- msg_string = edit_message(msg_string)
-
return msg_string.strip('\n')
def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
return msg_string.strip('\n')
def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
@@
-422,6
+422,9
@@
def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
raise CmdException, 'Only "%(name)s" variables are ' \
'supported in the patch template'
raise CmdException, 'Only "%(name)s" variables are ' \
'supported in the patch template'
+ if options.edit_patches:
+ msg_string = __edit_message(msg_string)
+
# The Python email message
try:
msg = email.message_from_string(msg_string)
# The Python email message
try:
msg = email.message_from_string(msg_string)
@@
-439,9
+442,6
@@
def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):
msg_string = msg.as_string(options.mbox)
msg_string = msg.as_string(options.mbox)
- if options.edit_patches:
- msg_string = edit_message(msg_string)
-
return msg_string.strip('\n')
def func(parser, options, args):
return msg_string.strip('\n')
def func(parser, options, args):