[patch 09/11] Allow mailing a given patch list
- From
- Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
- Date
- Sep 16, 2005, 19:35 UTC
- Message-ID
- <20050916193522.18681.94911.stgit@zion.home.lan>
- In-Reply-To
- <20050916193511.18681.24189.stgit@zion.home.lan>
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
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 <blaisorblade@yahoo.it> ---
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: