try to merge the givent branch into the current one If something does not goes smoothly, merge is aborted Returns True if merge successful, False otherwise
(repo, branch )
| 19 | not_merged = {} |
| 20 | |
| 21 | def merge_branch(repo, branch ): |
| 22 | """try to merge the givent branch into the current one |
| 23 | |
| 24 | If something does not goes smoothly, merge is aborted |
| 25 | |
| 26 | Returns True if merge successful, False otherwise |
| 27 | """ |
| 28 | # Delete the branch first |
| 29 | try : |
| 30 | check_call(['git', 'pull', repo, branch], stdin=io.open(os.devnull)) |
| 31 | except CalledProcessError : |
| 32 | check_call(['git', 'merge', '--abort']) |
| 33 | return False |
| 34 | return True |
| 35 | |
| 36 | |
| 37 | def git_new_branch(name): |