summaryrefslogtreecommitdiffstats
path: root/src/fedpkg.py
diff options
context:
space:
mode:
authorJochen Schmitt <Jochen@herr-schmitt.de>2010-09-16 20:05:45 +0200
committerJesse Keating <jkeating@redhat.com>2010-09-20 13:17:14 -0700
commit16a524c980984505914635c9c232366bf5aa27d2 (patch)
treec50169a8cf7b5cd53044726faa7e1651efd4cc43 /src/fedpkg.py
parent813ad6cee2034615a5571126bbd1c8886d5cfe2e (diff)
downloadfedora-packager-16a524c980984505914635c9c232366bf5aa27d2.zip
fedora-packager-16a524c980984505914635c9c232366bf5aa27d2.tar.gz
fedora-packager-16a524c980984505914635c9c232366bf5aa27d2.tar.xz
Implenentation of a tag command
Hello Jesse, this patch contains a tag command for fedpkg. I have divede the tag function in __init__.py into three functions for add, delete and list tags. All this functions lives outside of the PackageModule class. Best Regards: Jochen Schmitt
Diffstat (limited to 'src/fedpkg.py')
-rwxr-xr-xsrc/fedpkg.py61
1 files changed, 60 insertions, 1 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index 4f707b8..0319c70 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -652,6 +652,35 @@ def switch_branch(args):
print('Locals:\n%s\nRemotes:\n %s' %
('\n'.join(locals), '\n '.join(remotes)))
+def tag(args):
+ if args.list:
+ try:
+ pyfedpkg.list_tag(args.tag)
+ except pyfedpkg.FedpkgError, e:
+ log.error('Could not create a list of the tag: %s' % e)
+ sys.exit(1)
+ elif args.delete:
+ try:
+ pyfedpkg.delete_tag(args.tag)
+ except pyfedpkg.FedpkgError, e:
+ log.error('Coult not delete tag: %s' % e)
+ sys.exit(1)
+ else:
+ filename = args.file
+ tagname = args.tag
+ try:
+ if not tagname or args.clog:
+ mymodule = pyfedpkg.PackageModule(args.path)
+ if not tagname:
+ tagname = mymodule.getnvr()
+ if clog:
+ mymodule.clog()
+ filename = 'clog'
+ pyfedpkg.add_tag(tagname, args.force, args.message, filename)
+ except pyfedpkg.FedpkgError, e:
+ log.error('Coult not create a tag: %s' % e)
+ sys.exit(1)
+
def tagrequest(args):
# not implimented
log.warning('Not implimented yet, got %s' % args)
@@ -871,7 +900,6 @@ packages will be built sequentially.
conflict_handler = 'resolve',
help = 'Alias for clone')
parser_co.set_defaults(command = clone)
-
# commit stuff
parser_commit = subparsers.add_parser('commit',
help = 'Commit changes')
@@ -1036,6 +1064,37 @@ packages will be built sequentially.
action = 'store_true')
parser_switchbranch.set_defaults(command = switch_branch)
+ # tag stuff
+ parser_tag = subparsers.add_parser('tag',
+ help = 'Managementz of git tags')
+ parser_tag.add_argument('-f', '--force',
+ default = False,
+ action = 'store_true',
+ help = 'Force the creation of the tag')
+ parser_tag.add_argument('-m', '--message',
+ default = None,
+ help = 'Use the given <msg> as the tag message')
+ parser_tag.add_argument('-c', '--clog',
+ default = False,
+ action = 'store_true',
+ help = 'Generate the tag message from the %Changelog section')
+ parser_tag.add_argument('-F', '--file',
+ default = None,
+ help = 'Take the tag message from the given file')
+ parser_tag.add_argument('-l', '--list',
+ default = False,
+ action = 'store_true',
+ help = 'List all tags with a given pattern, or all if not pattern is given')
+ parser_tag.add_argument('-d', '--delete',
+ default = False,
+ action = 'store_true',
+ help = 'Delete a tag')
+ parser_tag.add_argument('tag',
+ nargs = '?',
+ default = None,
+ help = 'Name of the tag')
+ parser_tag.set_defaults(command = tag)
+
# Create a releng tag request
parser_tagrequest = subparsers.add_parser('tag-request',
help = 'Submit last build as a releng tag request')