Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
-import sys, os
+import sys, os, re
from optparse import OptionParser, make_option
from stgit.utils import *
for filename in conflicts:
resolved(filename)
os.remove(os.path.join(git.base_dir, 'conflicts'))
+
+def name_email(string):
+ """Return a tuple consisting of the name and email parsed from a
+ standard 'name <email>' string
+ """
+ names = re.split('([^<>]*)<([^<>]*)>', string)
+ if len(names) != 4:
+ raise CmdException, 'Incorrect "name <email>" string: %s' % string
+
+ return tuple([names[1].strip(), names[2].strip()])
options = [make_option('-m', '--message',
help = 'use MESSAGE as the patch description'),
+ make_option('-a', '--author', metavar = '"NAME <EMAIL>"',
+ help = 'use "NAME <EMAIL>" as the author details'),
make_option('--authname',
help = 'use AUTHNAME as the author name'),
make_option('--authemail',
check_conflicts()
check_head_top_equal()
+ if options.author:
+ options.authname, options.authemail = name_email(options.author)
+
crt_series.new_patch(args[0], message = options.message,
author_name = options.authname,
author_email = options.authemail,
make_option('-m', '--message',
help = 'use MESSAGE as the patch ' \
'description'),
+ make_option('-a', '--author', metavar = '"NAME <EMAIL>"',
+ help = 'use "NAME <EMAIL>" as the author details'),
make_option('--authname',
help = 'use AUTHNAME as the author name'),
make_option('--authemail',
if not options.force:
check_head_top_equal()
+ if options.author:
+ options.authname, options.authemail = name_email(options.author)
+
if git.local_changes() \
or not crt_series.head_top_equal() \
or options.edit or options.message \