if not pattern.match(date):
message.append(WRONG_DATE_MSG % date)
- # Check if change is still under review
- cmd = '--current-patch-set status: open project: %s commit: %s' % \
- (event['project'], psr)
- gerritinfo = mygerrit.query(cmd)
- if len(gerritinfo) == 1 and 'number' in gerritinfo[0] \
- and 'currentPatchSet' in gerritinfo[0]:
- if gerritinfo[0]['branch'] == branch:
- # the tagged commit still open, abort submit this time
- message.append(UNDER_REVIEW_MSG % (tag, psr))
- else:
- # cannot find tagged commit in git tree or gerrit open change
- message.append(WRONG_COMMIT_MSG % psr)
+ if not git.branch_contains(tag):
+ # Check if change is still under review
+ cmd = '--current-patch-set status: open project: %s commit: %s' % \
+ (event['project'], psr)
+ gerritinfo = mygerrit.query(cmd)
+ if len(gerritinfo) == 1 and 'number' in gerritinfo[0] \
+ and 'currentPatchSet' in gerritinfo[0]:
+ if gerritinfo[0]['branch'] == branch:
+ # the tagged commit still open, abort submit this time
+ message.append(UNDER_REVIEW_MSG % (tag, psr))
+ else:
+ # cannot find tagged commit in git tree or gerrit open change
+ message.append(WRONG_COMMIT_MSG % psr)
else:
# wrong tag format
message.append(UNKNOWN_FORMAT_MSG)