Skip to content

Commit

Permalink
Tweak the changelog generator a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
gazpachoking committed Sep 7, 2013
1 parent 42bb371 commit 01ec40d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gen-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
print 'Output dir doesn\'t exist: %s' % sys.argv[1]
sys.exit(1)
out_path = sys.argv[1]

# 1.0.3280 was last revision on svn
git_log_output = subprocess.check_output(['git', 'log', '--pretty=%n---%n.%d%n%ci%n%h%n%s%n%-b%n---%n', '--topo-order', 'refs/tags/1.0.3280..HEAD'])
git_log_output = subprocess.check_output(['git', 'log', '--pretty=%n---%n.%d%n%ci%n%h%n%s%n%-b%n---%n',
'--topo-order', '--decorate=full','refs/tags/1.0.3280..HEAD'])
git_log_iter = ifilter(None, git_log_output.decode('utf-8').splitlines())

with codecs.open(out_path, 'w', encoding='utf-8') as out_file:
for line in git_log_iter:
assert line == '---'
tag = re.search('tag: ([\d.]+)', next(git_log_iter))
tag = re.search('refs/tags/([\d.]+)', next(git_log_iter))
date = dateutil.parser.parse(next(git_log_iter))
commit_hash = next(git_log_iter)
body = list(iter(git_log_iter.next, '---'))
Expand Down

0 comments on commit 01ec40d

Please sign in to comment.