|
|
|
|
@ -51,7 +51,7 @@ A total of %d pull requests were merged for this release.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_authors(revision_range): |
|
|
|
|
pat = u'^.*\\t(.*)$' |
|
|
|
|
pat = '^.*\\t(.*)$' |
|
|
|
|
lst_release, cur_release = [r.strip() for r in revision_range.split('..')] |
|
|
|
|
|
|
|
|
|
# authors, in current release and previous to current release. |
|
|
|
|
@ -61,7 +61,7 @@ def get_authors(revision_range):
|
|
|
|
|
re.M)) |
|
|
|
|
|
|
|
|
|
# Append '+' to new authors. |
|
|
|
|
authors = [s + u' +' for s in cur - pre] + [s for s in cur & pre] |
|
|
|
|
authors = [s + ' +' for s in cur - pre] + [s for s in cur & pre] |
|
|
|
|
authors.sort() |
|
|
|
|
return authors |
|
|
|
|
|
|
|
|
|
@ -72,17 +72,17 @@ def get_pull_requests(repo, revision_range):
|
|
|
|
|
# From regular merges |
|
|
|
|
merges = this_repo.git.log( |
|
|
|
|
'--oneline', '--merges', revision_range) |
|
|
|
|
issues = re.findall(u"Merge pull request \\#(\\d*)", merges) |
|
|
|
|
issues = re.findall("Merge pull request \\#(\\d*)", merges) |
|
|
|
|
prnums.extend(int(s) for s in issues) |
|
|
|
|
|
|
|
|
|
# From Homu merges (Auto merges) |
|
|
|
|
issues = re. findall(u"Auto merge of \\#(\\d*)", merges) |
|
|
|
|
issues = re. findall("Auto merge of \\#(\\d*)", merges) |
|
|
|
|
prnums.extend(int(s) for s in issues) |
|
|
|
|
|
|
|
|
|
# From fast forward squash-merges |
|
|
|
|
commits = this_repo.git.log( |
|
|
|
|
'--oneline', '--no-merges', '--first-parent', revision_range) |
|
|
|
|
issues = re.findall(u'^.*\\(\\#(\\d+)\\)$', commits, re.M) |
|
|
|
|
issues = re.findall('^.*\\(\\#(\\d+)\\)$', commits, re.M) |
|
|
|
|
prnums.extend(int(s) for s in issues) |
|
|
|
|
|
|
|
|
|
# get PR data from github repo |
|
|
|
|
@ -99,19 +99,19 @@ def main(token, revision_range):
|
|
|
|
|
|
|
|
|
|
# document authors |
|
|
|
|
authors = get_authors(revision_range) |
|
|
|
|
heading = u"Contributors" |
|
|
|
|
heading = "Contributors" |
|
|
|
|
print() |
|
|
|
|
print(heading) |
|
|
|
|
print("=" * len(heading)) |
|
|
|
|
print(author_msg % len(authors)) |
|
|
|
|
|
|
|
|
|
for s in authors: |
|
|
|
|
print(u'* ' + s) |
|
|
|
|
print('* ' + s) |
|
|
|
|
|
|
|
|
|
# document pull requests |
|
|
|
|
pull_requests = get_pull_requests(github_repo, revision_range) |
|
|
|
|
heading = u"Pull requests merged" |
|
|
|
|
pull_msg = u"* `#{0} <{1}>`__: {2}" |
|
|
|
|
heading = "Pull requests merged" |
|
|
|
|
pull_msg = "* `#{0} <{1}>`__: {2}" |
|
|
|
|
|
|
|
|
|
print() |
|
|
|
|
print(heading) |
|
|
|
|
@ -119,11 +119,11 @@ def main(token, revision_range):
|
|
|
|
|
print(pull_request_msg % len(pull_requests)) |
|
|
|
|
|
|
|
|
|
for pull in pull_requests: |
|
|
|
|
title = re.sub(u"\\s+", u" ", pull.title.strip()) |
|
|
|
|
title = re.sub("\\s+", " ", pull.title.strip()) |
|
|
|
|
if len(title) > 60: |
|
|
|
|
remainder = re.sub(u"\\s.*$", u"...", title[60:]) |
|
|
|
|
remainder = re.sub("\\s.*$", "...", title[60:]) |
|
|
|
|
if len(remainder) > 20: |
|
|
|
|
remainder = title[:80] + u"..." |
|
|
|
|
remainder = title[:80] + "..." |
|
|
|
|
else: |
|
|
|
|
title = title[:60] + remainder |
|
|
|
|
print(pull_msg.format(pull.number, pull.html_url, title)) |
|
|
|
|
|