From: Zhang Qiang Date: Mon, 28 Jan 2013 16:41:12 +0000 (-0500) Subject: Add tag format check X-Git-Tag: 0.13~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f49d7c0ea7b0755ab309818d570419803a6f45d;p=tools%2Fgbs.git Add tag format check Currently, valid tag format is: submit/$target/$date.$time Change-Id: Ie209565c1dc20bdc9e27a46579da5dbc902432f9 --- diff --git a/gitbuildsys/cmd_submit.py b/gitbuildsys/cmd_submit.py index 181e4f1..5e466e4 100644 --- a/gitbuildsys/cmd_submit.py +++ b/gitbuildsys/cmd_submit.py @@ -19,6 +19,7 @@ """Implementation of subcmd: submit""" import os +import re import time from gitbuildsys.utils import edit @@ -77,6 +78,11 @@ def main(args): if args.tag: tagname = args.tag + tag_re = re.compile(r'^submit/\S+/\d{8}\.\d{6}$') + if not tag_re.match(tagname): + raise GbsError("invalid tag %s, valid tag format is " + "submit/$target/$date.$time. For example:\n " + "submit/trunk/20130128.022439 " % tagname) else: target = args.target if not target: