return set of PRs that have been backported already
(branch, since_tag=None)
| 116 | backport_re = re.compile(r"(?:[Bb]ackport|[Mm]erge).*#(\d+)") |
| 117 | |
| 118 | def already_backported(branch, since_tag=None): |
| 119 | """return set of PRs that have been backported already""" |
| 120 | if since_tag is None: |
| 121 | since_tag = check_output(['git','describe', branch, '--abbrev=0']).decode('utf8').strip() |
| 122 | cmd = ['git', 'log', '%s..%s' % (since_tag, branch), '--oneline'] |
| 123 | lines = check_output(cmd).decode('utf8') |
| 124 | return set(int(num) for num in backport_re.findall(lines)) |
| 125 | |
| 126 | def should_backport(labels=None, milestone=None, project='ipython/ipython'): |
| 127 | """return set of PRs marked for backport""" |