Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7c7684b1f1f61fcb75748a2d42042f4025ea1c6d
https://github.com/WebKit/WebKit/commit/7c7684b1f1f61fcb75748a2d42042f4025ea1c6d
Author: Sam Sneddon <[email protected]>
Date: 2026-06-08 (Mon, 08 Jun 2026)
Changed paths:
M Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py
M Tools/Scripts/webkitpy/w3c/test_exporter.py
M Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py
Log Message:
-----------
[export-w3c-test-changes] Fix behaviour with an already-existing branch
https://bugs.webkit.org/show_bug.cgi?id=307376
rdar://170508778
Reviewed by Elliott Williams.
The old code wrapped `checkout -b` in a try/except, but
_run_wpt_git never raises on failure (no check=True), so the retry
path that deleted and recreated the branch was unreachable. Replace
with `checkout -B` which creates the branch or resets it if it already
exists.
When pushing to a fork where the remote branch already exists, look
for an existing open pull request and update it instead of creating a
duplicate.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
Fix `checkout -B` mock to pass create=True and correctly handle the
reset-existing-branch semantics (delete-then-recreate versus
reset-to-start-point).
* Tools/Scripts/webkitpy/w3c/test_exporter.py:
(WebPlatformTestExporter.create_branch_with_patch): Use `checkout -B`
instead of `checkout -b` with exception-based retry.
(WebPlatformTestExporter.create_wpt_pull_request): Check for an
existing open PR via find_existing_pull_request and update it rather
than creating a new one. If the existing PR is closed, create a new PR.
(parse_args): Remove stale FIXME about not supporting PR updates.
* Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.test_export_local_branch_exists):
(TestExporterTest.test_export_remote_branch_exists_no_pr):
(TestExporterTest.test_export_updates_existing_open_pr):
(TestExporterTest.test_export_local_and_remote_exist_with_open_pr):
(TestExporterTest.test_export_creates_new_pr_when_existing_is_closed):
Canonical link: https://commits.webkit.org/314744@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications