diff options
author | Jochen Schmitt <Jochen@herr-schmitt.de> | 2010-09-16 20:05:49 +0200 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-09-20 13:19:37 -0700 |
commit | c142a78896e27cf6b43135a12379c2f8ae1eb572 (patch) | |
tree | 1346f3516305016eb0c95e77ac2af0c6b62269ec /src | |
parent | 28e4985e215a8313841491c7d5794eb3c597ac8b (diff) | |
download | fedora-packager-c142a78896e27cf6b43135a12379c2f8ae1eb572.tar.gz fedora-packager-c142a78896e27cf6b43135a12379c2f8ae1eb572.tar.xz fedora-packager-c142a78896e27cf6b43135a12379c2f8ae1eb572.zip |
Add a -t (tag) switch for the commit command
Hello Jesse,
this patch implenents a -t (tag) switch for the commit
command. Because you have wrote, that you don't like to
see additional function in the PackageModule class, I
have refactor this patch to fullfill your requirements.
Best Regards:
Jochen Schmitt
Diffstat (limited to 'src')
-rw-r--r-- | src/fedpkg.bash | 2 | ||||
-rwxr-xr-x | src/fedpkg.py | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/fedpkg.bash b/src/fedpkg.bash index 9ec0f02..300d0d6 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -108,7 +108,7 @@ _fedpkg() after="package" ;; commit|ci) - options="--push -p --clog -c" + options="--push -p --clog -c --tag -t" options_string="--message -m" options_file="--file -F" after="file" diff --git a/src/fedpkg.py b/src/fedpkg.py index 405eb3f..3a9b65a 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -440,6 +440,7 @@ def clone(args): sys.exit(1) def commit(args): + mymodule = None if args.clog: try: mymodule = pyfedpkg.PackageModule(args.path) @@ -453,6 +454,18 @@ def commit(args): except pyfedpkg.FedpkgError, e: log.error('Could not commit: %s' % e) sys.exit(1) + if args.tag: + try: + if not mymodule: + mymodule = pyfedpkg.PackageModule(args.path) + tagname = mymodule.getnvr() + filename = args.file + if args.clog: + filename = 'clog' + pyfedpkg.add_tag(tagname, True, args.message, filename) + except pyfedpkg.FedpkgError, e: + log.error('Coult not create a tag: %s' % e) + sys.exit(1) if args.push: push(args) @@ -921,6 +934,10 @@ packages will be built sequentially. default = False, action = 'store_true', help = 'Generate the commit message from the %Changelog section') + parser_commit.add_argument('-t', '--tag', + default = False, + action = 'store_true', + help = 'Create a tag for this commit') parser_commit.add_argument('-m', '--message', default = None, help = 'Use the given <msg> as the commit message') |