Skip to content

Commit

Permalink
Remove unmerged PRs from changelog
Browse files Browse the repository at this point in the history
Integration branches and other exeriments should never
have changed master
  • Loading branch information
guyer committed Jun 2, 2022
1 parent 278a4f4 commit a4cc7ca
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion _setup/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ def _getDateFromTagOrSHA(self, tagOrSHA):

return date

def read_pull(self, x):
if x['pull_request'] is None:
result = (False, None)
else:
pull = self.repo.get_pull(x.number)
result = (pull.merged, pull.merged_at)
return result

def format_pull(self, x):
prefix = "- "
hang = " " * len(prefix)
Expand Down Expand Up @@ -206,9 +214,11 @@ def run(self):
ispull = issues['pull_request'].notna()
isissue = ~ispull

issues['merged'], issues['merged_at'] = zip(*issues.apply(self.read_pull, axis=1))

issues.loc[ispull, 'ReST'] = issues.apply(self.format_pull, axis=1)

issues.loc[isissue, 'ReST'] = issues.apply(self.format_issue, axis=1)

self._printReST(issues[ispull], "Pulls")
self._printReST(issues[ispull & issues['merged']], "Pulls")
self._printReST(issues[isissue], "Fixes")

0 comments on commit a4cc7ca

Please sign in to comment.