Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d1c5b2c0162a8e505bf55c7051e1a0412ab7eaff
https://github.com/WebKit/WebKit/commit/d1c5b2c0162a8e505bf55c7051e1a0412ab7eaff
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] Support --delete-existing/--no-delete-existing
https://bugs.webkit.org/show_bug.cgi?id=295350
rdar://155454170
Reviewed by Elliott Williams.
Add a --delete-existing/--no-delete-existing flag, similar to the one
git-webkit already supports, to control whether the exporter may
overwrite existing local branches or force-push to existing remote
branches. Unlike git-webkit, which defaults to rebasing an existing
branch, the exporter defaults to --no-delete-existing and refuses to
proceed when it finds pre-existing state.
As part of this, stop unconditionally force-pushing: push without
-f first, parse the --porcelain output to detect a non-fast-forward
rejection, and only force-push if --delete-existing was given.
* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/mocks/local/git.py:
(Git): Add push_error property for injecting push failures in tests.
Add show-ref --verify --quiet and push --porcelain routes, along with
show_ref_verify and push_porcelain methods.
* Tools/Scripts/webkitpy/w3c/test_exporter.py:
(WebPlatformTestExporter.create_branch_with_patch): Check whether the
local branch exists with show-ref --verify --quiet; refuse to proceed
without --delete-existing. Use checkout -b when creating, -B when
overwriting.
(WebPlatformTestExporter.push_to_wpt_fork): Replace unconditional
push -f with push --porcelain; parse output to distinguish
non-fast-forward rejections from fatal errors, and only force-push on
rejection when --delete-existing is set.
(parse_args): Add --delete-existing/--no-delete-existing via
arguments.NoAction.
* Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.test_export_local_branch_exists): Pass
--delete-existing.
(TestExporterTest.test_export_remote_branch_exists_no_pr): Ditto.
(TestExporterTest.test_export_updates_existing_open_pr): Ditto.
(TestExporterTest.test_export_local_and_remote_exist_with_open_pr):
Ditto.
(TestExporterTest.test_export_creates_new_pr_when_existing_is_closed):
Ditto.
(TestExporterTest.test_export_local_branch_exists_errors_without_flag):
(TestExporterTest.test_export_remote_branch_exists_errors_without_flag):
(TestExporterTest.test_export_push_fatal_error):
(TestExporterTest.test_export_push_non_rejected_error):
(TestExporterTest.test_export_open_pr_errors_without_flag):
(TestExporterTest.test_export_local_and_open_pr_errors_without_flag):
(TestExporterTest.test_export_closed_pr_succeeds_without_flag):
Canonical link: https://commits.webkit.org/314747@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications