try to merge the branch of PR `num` into current branch
(num)
| 41 | |
| 42 | |
| 43 | def merge_pr(num): |
| 44 | """ try to merge the branch of PR `num` into current branch |
| 45 | """ |
| 46 | # Get Github authorisation first, so that the user is prompted straight away |
| 47 | # if their login is needed. |
| 48 | |
| 49 | pr = gh_api.get_pull_request(gh_project, num) |
| 50 | repo = pr['head']['repo']['clone_url'] |
| 51 | |
| 52 | |
| 53 | branch = pr['head']['ref'] |
| 54 | mergeable = merge_branch(repo=repo, |
| 55 | branch=branch, |
| 56 | ) |
| 57 | if not mergeable : |
| 58 | cmd = "git pull "+repo+" "+branch |
| 59 | not_merged[str(num)] = cmd |
| 60 | print("==============================================================================") |
| 61 | print("Something went wrong merging this branch, you can try it manually by running :") |
| 62 | print(cmd) |
| 63 | print("==============================================================================") |
| 64 | |
| 65 | |
| 66 | def main(*args): |