[patch 09/11] Allow mailing a given patch list
From: Paolo 'Blaisorblade' Giarrusso <hidden>
Date: 2016-06-15 22:42:06
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Paolo 'Blaisorblade' Giarrusso <redacted> I tried to mail a cherry-picked subset of my series and that didn't work - using stg export and quilt was even worse, so I had to code something. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <redacted> --- stgit/commands/mail.py | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py@@ -26,7 +26,7 @@ from stgit.config import config help = 'send a patch or series of patches by e-mail' -usage = """%prog [options] [<patch>] +usage = """%prog [options] [<patch> [<patch2...]] Send a patch or a range of patches (defaulting to the applied patches) by e-mail using the 'smtpserver' configuration option. The From
@@ -265,9 +265,6 @@ def func(parser, options, args): """Send the patches by e-mail using the patchmail.tmpl file as a template """ - if len(args) > 1: - parser.error('incorrect number of arguments') - if not config.has_option('stgit', 'smtpserver'): raise CmdException, 'smtpserver not defined' smtpserver = config.get('stgit', 'smtpserver')
@@ -281,11 +278,11 @@ def func(parser, options, args): applied = crt_series.get_applied() - if len(args) == 1: - if args[0] in applied: - patches = [args[0]] - else: - raise CmdException, 'Patch "%s" not applied' % args[0] + if len(args) >= 1: + for patch in args: + if not patch in applied: + raise CmdException, 'Patch "%s" not applied' % patch + patches = args elif options.all: patches = applied elif options.range: