cutarelease: tigher "$version" commit message for release ver; add date to release tag

This commit is contained in:
Trent Mick 2016-02-11 21:31:52 -08:00
parent 6fdc5ff209
commit 1baff9d57b

View file

@ -26,6 +26,7 @@ import codecs
import logging import logging
import optparse import optparse
import json import json
import time
@ -152,14 +153,15 @@ def cutarelease(project_name, version_files, dry_run=False):
f = codecs.open(changes_path, 'w', 'utf-8') f = codecs.open(changes_path, 'w', 'utf-8')
f.write(changes_txt) f.write(changes_txt)
f.close() f.close()
run('git commit %s -m "prepare for %s release"' run('git commit %s -m "%s"'
% (changes_path, version)) % (changes_path, version))
# Tag version and push. # Tag version and push.
curr_tags = set(t for t in _capture_stdout(["git", "tag", "-l"]).split('\n') if t) curr_tags = set(t for t in _capture_stdout(["git", "tag", "-l"]).split('\n') if t)
if not dry_run and version not in curr_tags: if not dry_run and version not in curr_tags:
log.info("tag the release") log.info("tag the release")
run('git tag -a "%s" -m "version %s"' % (version, version)) date = time.strftime("%Y-%m-%d")
run('git tag -a "%s" -m "version %s (%s)"' % (version, version, date))
run('git push --tags') run('git push --tags')
# Optionally release. # Optionally release.
@ -248,7 +250,7 @@ def cutarelease(project_name, version_files, dry_run=False):
f.close() f.close()
if not dry_run: if not dry_run:
run('git commit %s %s -m "prep for future dev"' % ( run('git commit %s %s -m "bumpver for subsequent work"' % (
changes_path, ' '.join(version_files))) changes_path, ' '.join(version_files)))
run('git push') run('git push')