aboutsummaryrefslogtreecommitdiff
path: root/git_buildpackage/__init__.py
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2006-12-08 16:32:32 +0100
committerGuido Guenther <agx@bogon.sigxcpu.org>2006-12-08 16:32:32 +0100
commit9e54f169eae8db3984302171d7772795deac9513 (patch)
tree83b2a252b55f35f57b18ba7c402383aa77e074a1 /git_buildpackage/__init__.py
parent960385597d124c0881a5779448beb4c0b6d85c9a (diff)
support signed tagsdebian/0.2.15
Diffstat (limited to 'git_buildpackage/__init__.py')
-rw-r--r--git_buildpackage/__init__.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/git_buildpackage/__init__.py b/git_buildpackage/__init__.py
index 29fe7b2..09a33f8 100644
--- a/git_buildpackage/__init__.py
+++ b/git_buildpackage/__init__.py
@@ -138,24 +138,33 @@ class GitPull(GitCommand):
"""Wrap git-pull"""
def __init__(self, repo, branch):
GitCommand.__init__(self,'pull', [repo, branch])
- self.run_error="Couldn't pull %s to %s" % (branch, repo)
+ self.run_error = "Couldn't pull %s to %s" % (branch, repo)
class GitTag(GitCommand):
"""Wrap git-tag"""
- def __init__(self):
- GitCommand.__init__(self,'tag')
-
- def __call__(self, tag):
- self.run_error="Couldn't tag %s" % (tag,)
- GitCommand.__call__(self, [tag])
+ def __init__(self, sign_tag=False, keyid=None):
+ GitCommand.__init__(self,'tag')
+ self.sign_tag = sign_tag
+ self.keyid = keyid
+
+ def __call__(self, version, msg="Tagging %(version)s"):
+ self.run_error="Couldn't tag %s" % (version,)
+ if self.sign_tag:
+ if self.keyid:
+ sign_opts = [ '-u', self.keyid ]
+ else:
+ sign_opts = [ '-s' ]
+ else:
+ sign_opts = []
+ GitCommand.__call__(self, sign_opts+[ '-m', msg % locals(), version])
class GitAdd(GitCommand):
"""Wrap git-add to add new files"""
def __init__(self):
GitCommand.__init__(self,'add')
- self.run_error="Couldn't add files"
+ self.run_error = "Couldn't add files"
class GitCommitAll(GitCommand):