@@ -35,7 +35,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name):
3535 commits_without_pull_requests = []
3636 for commit in all_commits :
3737 pr = get_pr_for_commit (repo , commit )
38-
38+
3939 if pr is None :
4040 commits_without_pull_requests .append (commit )
4141 elif not any (p for p in pull_requests if p .number == pr .number ):
@@ -47,7 +47,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name):
4747 # Sort PRs and commits by age
4848 pull_requests = sorted (pull_requests , key = lambda pr : pr .number )
4949 commits_without_pull_requests = sorted (commits_without_pull_requests , key = lambda c : c .commit .author .date )
50-
50+
5151 # Start constructing the body text
5252 body = 'Merging ' + short_main_sha + ' into ' + LATEST_RELEASE_BRANCH
5353
@@ -62,7 +62,7 @@ def open_pr(repo, all_commits, short_main_sha, branch_name):
6262 body += '\n - #' + str (pr .number )
6363 body += ' - ' + pr .title
6464 body += ' (@' + merger + ')'
65-
65+
6666 # List all commits not part of a PR
6767 if len (commits_without_pull_requests ) > 0 :
6868 body += '\n \n Contains the following commits not from a pull request:'
@@ -86,7 +86,7 @@ def get_conductor(repo, pull_requests, other_commits):
8686 # If there are any PRs then use whoever merged the last one
8787 if len (pull_requests ) > 0 :
8888 return get_merger_of_pr (repo , pull_requests [- 1 ])
89-
89+
9090 # Otherwise take the author of the latest commit
9191 return other_commits [- 1 ].author .login
9292
@@ -95,7 +95,7 @@ def get_conductor(repo, pull_requests, other_commits):
9595# This will not include any commits that exist on the release branch
9696# that aren't on main.
9797def get_commit_difference (repo ):
98- commits = run_git ('log' , '--pretty=format:%H' , ORIGIN + '/' + LATEST_RELEASE_BRANCH + '... ' + MAIN_BRANCH ).strip ().split ('\n ' )
98+ commits = run_git ('log' , '--pretty=format:%H' , ORIGIN + '/' + LATEST_RELEASE_BRANCH + '..' + MAIN_BRANCH ).strip ().split ('\n ' )
9999
100100 # Convert to full-fledged commit objects
101101 commits = [repo .get_commit (c ) for c in commits ]
@@ -119,7 +119,7 @@ def get_truncated_commit_message(commit):
119119# Returns the PR object, or None if no PR could be found.
120120def get_pr_for_commit (repo , commit ):
121121 prs = commit .get_pulls ()
122-
122+
123123 if prs .totalCount > 0 :
124124 # In the case that there are multiple PRs, return the earliest one
125125 prs = list (prs )
@@ -165,7 +165,7 @@ def main():
165165 if branch_exists_on_remote (new_branch_name ):
166166 print ('Branch ' + new_branch_name + ' already exists. Nothing to do.' )
167167 return
168-
168+
169169 # Create the new branch and push it to the remote
170170 print ('Creating branch ' + new_branch_name )
171171 run_git ('checkout' , '-b' , new_branch_name , MAIN_BRANCH )
0 commit comments