summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-10-24 14:12:59 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-26 09:44:24 +0200
commitd6999f791909f22c9846e24b45a7032540894691 (patch)
tree069c4c08197a1bdf1d0097c40811b13edac7c587 /gbp/git.py
parent718f0c3dda9c9691d6e99821aca89a440d5075e7 (diff)
Replace GitTag by GitRepository.create_tag()
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 7566635..34d8140 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -274,6 +274,30 @@ class GitRepository(object):
self._git_command("tag", [ new, old ])
self.remove_tag(old)
+ def create_tag(self, name, msg=None, commit=None, sign=False, keyid=None):
+ """
+ Create a new tag.
+
+ @param name: the tag's name
+ @type name: string
+ @param msg: The tag message.
+ @type msg: string
+ @param commit: the commit or object to create the tag at, default
+ is I{HEAD}
+ @type commit: string
+ @param sign: Whether to sing the tag
+ @type sign: bool
+ @param keyid: the GPG keyid used to sign the tag
+ @type keyid: string
+ """
+ args = []
+ args += [ '-m', msg ] if msg else []
+ if sign:
+ args += [ '-u', keyid ] if keyid else [ '-s' ]
+ args += [ name ]
+ args += [ commit ] if commit else []
+ self._git_command("tag", args)
+
def get_branch(self):
"""on what branch is the current working copy"""
for line in self.__git_getoutput('branch', [ '--no-color' ])[0]: