tasn pushed a commit to branch master. http://git.enlightenment.org/admin/release-management.git/commit/?id=a85b1b120a5acaea4122e4d0b0517a2e56ae1002
commit a85b1b120a5acaea4122e4d0b0517a2e56ae1002 Author: Tom Hacohen <[email protected]> Date: Tue Mar 11 12:50:05 2014 +0000 Finished the news generator. --- generate_news.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/generate_news.py b/generate_news.py index 08f31ff..26c8596 100755 --- a/generate_news.py +++ b/generate_news.py @@ -22,8 +22,38 @@ def news_entry_get(commit): else: return "{} ({})".format(log['subject'], ', '.join(extra_info)) +def commit_list_by_type_get(commit_range, list_type): + cmd = ['git', 'log', '--format=format:%H'] + if list_type == 'feature': + cmd.extend(['--grep', '@feature']) + elif list_type == 'fix': + cmd.extend(['--grep', '@fix', '--grep', '@bugfix']) + + cmd.append(commit_range) + out = subprocess.check_output(cmd) + ret = out.split('\n') + if ret[0] == '': + return None + else: + return ret + +def news_range_print(commit_range, list_type): + commit_list = commit_list_by_type_get(commit_range, list_type) + if commit_list: + for commit in reversed(commit_list): + print(' * {}'.format(news_entry_get(commit))) + +def news_features_print(commit_range): + print('Features:\n') + news_range_print(commit_range, 'feature') + +def news_fixes_print(commit_range): + print('Fixes:\n') + news_range_print(commit_range, 'fix') + def run(args): - pass + news_features_print(args.commit_range) + news_fixes_print(args.commit_range) if __name__ == '__main__': import argparse --
