c36e1099faac31f7253f34893c554d5cb5d6206b
3 Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 as
7 published by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 from optparse
import OptionParser
, make_option
22 from stgit
.commands
.common
import *
23 from stgit
.utils
import *
24 from stgit
import stack
, git
27 help = 'create a new patch and make it the topmost one'
28 usage
= '%prog [options] <name>'
30 options
= [make_option('-m', '--message',
31 help = 'use MESSAGE as the patch description'),
32 make_option('--force',
33 help = 'proceed even if there are local changes',
34 action
= 'store_true'),
35 make_option('-a', '--author', metavar
= '"NAME <EMAIL>"',
36 help = 'use "NAME <EMAIL>" as the author details'),
37 make_option('--authname',
38 help = 'use AUTHNAME as the author name'),
39 make_option('--authemail',
40 help = 'use AUTHEMAIL as the author e-mail'),
41 make_option('--authdate',
42 help = 'use AUTHDATE as the author date'),
43 make_option('--commname',
44 help = 'use COMMNAME as the committer name'),
45 make_option('--commemail',
46 help = 'use COMMEMAIL as the committer e-mail')]
49 def func(parser
, options
, args
):
50 """Creates a new patch
53 parser
.error('incorrect number of arguments')
58 check_head_top_equal()
61 options
.authname
, options
.authemail
= name_email(options
.author
)
63 crt_series
.new_patch(args
[0], message
= options
.message
,
64 author_name
= options
.authname
,
65 author_email
= options
.authemail
,
66 author_date
= options
.authdate
,
67 committer_name
= options
.commname
,
68 committer_email
= options
.commemail
)