summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-20 13:53:50 -0700
committerJesse Keating <jkeating@redhat.com>2010-09-20 13:53:50 -0700
commita84e02917af598b0cc050694809dd351913ddd73 (patch)
tree930d1c5ba60db7d1fec0c26381a53e72eb2e0ed2
parent7783646df117dab495ca6b5831a762cbebda73eb (diff)
downloadfedora-packager-a84e02917af598b0cc050694809dd351913ddd73.tar.gz
fedora-packager-a84e02917af598b0cc050694809dd351913ddd73.tar.xz
fedora-packager-a84e02917af598b0cc050694809dd351913ddd73.zip
Fix up tag commands
Minor clean ups from jochen's submission
-rwxr-xr-xsrc/fedpkg.py6
-rw-r--r--src/pyfedpkg/__init__.py18
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)