From: Paolo 'Blaisorblade' Giarrusso Date: Fri, 16 Sep 2005 19:35:22 +0000 (+0200) Subject: Allow mailing a given patch list X-Git-Tag: v0.14.3~669 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/ddab48a5c0da11082de6fd3a530ee491f04aa19c Allow mailing a given patch list From: Paolo 'Blaisorblade' Giarrusso 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 --- diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 45b2ca8..9f4b3d1 100644 --- 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] [] +usage = """%prog [options] [ [ 1: - parser.error('incorrect number of arguments') - if not config.has_option('stgit', 'smtpserver'): raise CmdException, 'smtpserver not defined' smtpserver = config.get('stgit', 'smtpserver') @@ -294,11 +291,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: