From: Lingchaox Xin Date: Wed, 19 Jun 2013 09:04:59 +0000 (+0800) Subject: Fix self.describe method call in gbp.git.repository X-Git-Tag: 0.14~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5ec5930c41f4af67727deb1ba0f7c9cba614f15;p=services%2Fjenkins-scripts.git Fix self.describe method call in gbp.git.repository A new method named describe appeared in gbp 36341dda, so use it instead of using customed describe method. Change-Id: Ie9cf5f8c61246f957789a102930e3b81cafac98d Reported-by: Hao H Huang Signed-off-by: Lingchaox Xin --- diff --git a/common/git.py b/common/git.py index 21aae06..f42ae40 100644 --- a/common/git.py +++ b/common/git.py @@ -84,12 +84,6 @@ class Git(GitRepository): ret = self._git_getoutput('fetch', list(args))[1] return not ret - def describe(self, *args): - """Show the most recent tag that is reachable from a commit - """ - outs, ret = self._git_getoutput('describe', list(args)) - return ''.join(outs).strip() if not ret else None - def delete_tag(self, *args): """Delete a tag (or tags)""" self._git_getoutput('tag', ['-d'] + list(args)) diff --git a/job_deletetag.py b/job_deletetag.py index f482f57..8537853 100755 --- a/job_deletetag.py +++ b/job_deletetag.py @@ -29,7 +29,7 @@ def delete_tags(mygit, revision): """Delete all tags which belongs to the same commit""" while 1: - result = mygit.describe('--tags', '--exact-match', revision) + result = mygit.describe(revision, tags=True, exact_match=True) if result: mygit.push('origin', ':refs/tags/%s' % result, '-f') mygit.delete_tag(result) diff --git a/job_submitobs.py b/job_submitobs.py index b084e07..d48e1eb 100755 --- a/job_submitobs.py +++ b/job_submitobs.py @@ -88,8 +88,8 @@ def find_submit_tag(event, mygit): branch = event['branch'] if event['branch'] == 'master': branch = 'trunk' - tag = mygit.describe('--exact-match', '--match', 'submit/%s/*' % - branch, event['patchset_revision']) + tag = mygit.describe(event['patchset_revision'], pattern='submit/%s/*' + % branch, exact_match=True) return tag