Skip to content

Commit

Permalink
[webkitscmpy] Support specified branch in find_existing_pull_request
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=261246
rdar://115084502

Reviewed by Elliott Williams.

* Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
(PullRequest.find_existing_pull_request): Allow caller to specify branch.

Canonical link: https://commits.webkit.org/268045@main
  • Loading branch information
JonWBedard committed Sep 16, 2023
1 parent 4473b14 commit dedaf00
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,11 @@ def pull_request_branch_point(cls, repository, args, **kwargs):
return branch_point

@classmethod
def find_existing_pull_request(cls, repository, remote):
def find_existing_pull_request(cls, repository, remote, branch=None):
branch = branch or repository.branch
existing_pr = None
user, _ = remote.credentials(required=False)
for pr in remote.pull_requests.find(opened=None, head=repository.branch):
for pr in remote.pull_requests.find(opened=None, head=branch):
existing_pr = pr
if not existing_pr.opened:
continue
Expand Down

0 comments on commit dedaf00

Please sign in to comment.