()
| 118 | @status("Getting base branch for PR", |
| 119 | info=lambda x: x if x is not None else "not a PR branch") |
| 120 | def get_base_branch(): |
| 121 | if not os.path.exists(os.path.join(SRCDIR, '.git')): |
| 122 | # Not a git checkout, so there's no base branch |
| 123 | return None |
| 124 | upstream_remote = get_git_upstream_remote() |
| 125 | version = sys.version_info |
| 126 | if version.releaselevel == 'alpha': |
| 127 | base_branch = get_git_remote_default_branch(upstream_remote) |
| 128 | else: |
| 129 | base_branch = "{0.major}.{0.minor}".format(version) |
| 130 | this_branch = get_git_branch() |
| 131 | if this_branch is None or this_branch == base_branch: |
| 132 | # Not on a git PR branch, so there's no base branch |
| 133 | return None |
| 134 | return upstream_remote + "/" + base_branch |
| 135 | |
| 136 | |
| 137 | @status("Getting the list of files that have been added/changed", |
no test coverage detected
searching dependent graphs…