From 28e4985e215a8313841491c7d5794eb3c597ac8b Mon Sep 17 00:00:00 2001 From: Jochen Schmitt Date: Thu, 16 Sep 2010 20:05:48 +0200 Subject: Add a -c (clog) switch to the commit command Hello Jesse, this patch add a -c (clong) switch for the commit commant. Best Regards: Jochen Schmitt --- src/fedpkg.bash | 2 +- src/fedpkg.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fedpkg.bash b/src/fedpkg.bash index bb57b94..9ec0f02 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -108,7 +108,7 @@ _fedpkg() after="package" ;; commit|ci) - options="--push -p" + options="--push -p --clog -c" options_string="--message -m" options_file="--file -F" after="file" diff --git a/src/fedpkg.py b/src/fedpkg.py index 8fc21ad..405eb3f 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -440,6 +440,14 @@ def clone(args): sys.exit(1) def commit(args): + if args.clog: + try: + mymodule = pyfedpkg.PackageModule(args.path) + mymodule.clog() + except pyfedpkg.FedpkgError, e: + log.error('coult not create clog: %s' % e) + sys.exit(1) + args.file = os.path.abspath('clog') try: pyfedpkg.commit(args.path, args.message, args.file, args.files) except pyfedpkg.FedpkgError, e: @@ -909,6 +917,10 @@ packages will be built sequentially. # commit stuff parser_commit = subparsers.add_parser('commit', help = 'Commit changes') + parser_commit.add_argument('-c', '--clog', + default = False, + action = 'store_true', + help = 'Generate the commit message from the %Changelog section') parser_commit.add_argument('-m', '--message', default = None, help = 'Use the given as the commit message') -- cgit