Using the --message option with the new command fails. Fix it.
[stgit] / stgit / commands / new.py
CommitLineData
fcee87cf
CM
1
2__copyright__ = """
3Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License version 2 as
7published by the Free Software Foundation.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17"""
18
19import sys, os
20from optparse import OptionParser, make_option
21
22from stgit.commands.common import *
23from stgit.utils import *
24from stgit import stack, git
25
26
27help = 'create a new patch and make it the topmost one'
28usage = '%prog [options] <name>'
29
30options = [make_option('-m', '--message',
31 help = 'use MESSAGE as the patch description'),
32 make_option('--authname',
33 help = 'use AUTHNAME as the author name'),
34 make_option('--authemail',
35 help = 'use AUTHEMAIL as the author e-mail'),
36 make_option('--authdate',
37 help = 'use AUTHDATE as the author date'),
38 make_option('--commname',
39 help = 'use COMMNAME as the committer name'),
40 make_option('--commemail',
41 help = 'use COMMEMAIL as the committer e-mail')]
42
43
44def func(parser, options, args):
45 """Creates a new patch
46 """
47 if len(args) != 1:
48 parser.error('incorrect number of arguments')
49
50 check_local_changes()
51 check_conflicts()
52 check_head_top_equal()
53
54 crt_series.new_patch(args[0], message = options.message,
55 author_name = options.authname,
56 author_email = options.authemail,
57 author_date = options.authdate,
58 committer_name = options.commname,
59 committer_email = options.commemail)