diff options
-rwxr-xr-x | src/fedpkg.py | 6 | ||||
-rw-r--r-- | src/pyfedpkg/__init__.py | 18 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index 5441e08..6c53b50 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -687,7 +687,7 @@ def tag(args): sys.exit(1) elif args.delete: try: - pyfedpkg.delete_tag(args.tag) + pyfedpkg.delete_tag(args.tag, args.path) except pyfedpkg.FedpkgError, e: log.error('Coult not delete tag: %s' % e) sys.exit(1) @@ -1110,7 +1110,7 @@ packages will be built sequentially. # tag stuff parser_tag = subparsers.add_parser('tag', - help = 'Managementz of git tags') + help = 'Management of git tags') parser_tag.add_argument('-f', '--force', default = False, action = 'store_true', @@ -1121,7 +1121,7 @@ packages will be built sequentially. parser_tag.add_argument('-c', '--clog', default = False, action = 'store_true', - help = 'Generate the tag message from the %Changelog section') + help = 'Generate the tag message from the spec changelog section') parser_tag.add_argument('-F', '--file', default = None, help = 'Take the tag message from the given file') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 6b9b6a1..9e15057 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -506,16 +506,14 @@ def commit(path=None, message=None, file=None, files=[]): _run_command(cmd, cwd=path) return -def delete_tag(tagname=None): - """Delete a git tag from the repository""" +def delete_tag(tagname, path=None): + """Delete a git tag from the repository found at optional path""" - if not tagname: - raise fedpkgError('Please specified a tagname') - cmd = ['git', 'tag'] - cmd.extend(['-d']) - cmd.extend(tagname) - _run_command(cmd) - log.info ('Tag %s was deleted' % ', '.join(delete)) + if not path: + path = os.getcwd() + cmd = ['git', 'tag', '-d', tagname] + _run_command(cmd, cwd=path) + log.info ('Tag %s was deleted' % tagname) def diff(path, cached=False, files=[]): """Excute a git diff @@ -657,7 +655,7 @@ def list_tag(tagname=None): cmd = ['git', 'tag'] cmd.extend(['-l']) - if not tagname == '*': + if tagname != '*': cmd.extend([tagname]) # make it so _run_command(cmd) |