Fix tag exsisting check logic
authorLingchaox Xin <lingchaox.xin@intel.com>
Wed, 29 May 2013 02:40:55 +0000 (10:40 +0800)
committerLingchaox Xin <lingchaox.xin@intel.com>
Thu, 30 May 2013 01:01:01 +0000 (09:01 +0800)
We maybe need rev_parse method to ensure tag exsisting indeed,
rather than simple str split.

Change-Id: I672fc38b8d839d0fe54890fb7e339b1564585a32

job_submitobs.py

index 392906d..b084e07 100755 (executable)
@@ -79,6 +79,10 @@ def find_submit_tag(event, mygit):
         tag = event['refname'][len('refs/tags/'):]
         event['branch'] = parse_submit_tag(tag)[0]
         event['patchset_revision'] = mygit.rev_parse(tag)
+        # Since patchset_revision is used in gerrit feedback, real tag check
+        # is needed; and the key point is parse_submit_tag can not ensure the
+        # tag exsisting too.
+        if not event['patchset_revision']: tag = None
     elif event['event_type'] == 'change-merged':
         # for chanage-merged, search submit tag on this commit
         branch = event['branch']