"'origin' as the remote server")
args.remote = 'origin'
- target = args.target
- if not target:
- if upstream and upstream.startswith(args.remote):
- target = os.path.basename(upstream)
- else:
- log.warning("Can't find upstream branch for current branch "
- "%s. Gbs uses the local branch name as the target. "
- "Please consider to use git-branch --set-upstream "
- "to set upstream remote branch." % current_branch)
- target = current_branch
-
- if target == 'master':
- target = 'trunk'
- tagname = 'submit/%s/%s' % (target, time.strftime( \
+ if args.tag:
+ tagname = args.tag
+ else:
+ target = args.target
+ if not target:
+ if upstream and upstream.startswith(args.remote):
+ target = os.path.basename(upstream)
+ else:
+ log.warning("Can't find upstream branch for current branch "
+ "%s. Gbs uses the local branch name as the target. "
+ "Please consider to use git-branch --set-upstream "
+ "to set upstream remote branch." % current_branch)
+ target = current_branch
+ if target == 'master':
+ target = 'trunk'
+ tagname = 'submit/%s/%s' % (target, time.strftime( \
'%Y%m%d.%H%M%S', time.gmtime()))
+
log.info('creating tag: %s' % tagname)
try:
repo.create_tag(tagname, msg=message, commit=commit, sign=args.sign,
default=os.getcwd(),
help='path to git repository')
+ parser.add_argument('--tag', help='create tag using specified tag name. '
+ 'This option can be used for group submission, and '
+ 'submissions with same tag can be seen as one group')
parser.add_argument('-m', '--msg', help='specify tag message info')
parser.add_argument('-c', '--commit', default='HEAD',
help='specify a commit ID to submit')