Fix self.describe method call in gbp.git.repository
authorLingchaox Xin <lingchaox.xin@intel.com>
Wed, 19 Jun 2013 09:04:59 +0000 (17:04 +0800)
committerLingchaox Xin <lingchaox.xin@intel.com>
Fri, 21 Jun 2013 07:44:47 +0000 (15:44 +0800)
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 <hao.h.huang@intel.com>
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
common/git.py
job_deletetag.py
job_submitobs.py

index 21aae06..f42ae40 100644 (file)
@@ -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))
index f482f57..8537853 100755 (executable)
@@ -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)
index b084e07..d48e1eb 100755 (executable)
@@ -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