From bc741bdc0bddbba8971270f510570606519d1aab Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 11 Dec 2024 06:50:40 -0500 Subject: [PATCH] Iterate PR commits in reverse (oldest->newest) when preparing WPT export. (#34567) Signed-off-by: Josh Matthews --- python/wpt/exporter/step.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/wpt/exporter/step.py b/python/wpt/exporter/step.py index 9781353ce15..9be91d65730 100644 --- a/python/wpt/exporter/step.py +++ b/python/wpt/exporter/step.py @@ -105,7 +105,9 @@ class CreateOrUpdateBranchForPRStep(Step): ).splitlines() filtered_commits = [] - for sha in commit_shas: + # We must iterate the commits in reverse to ensure we apply older changes first, + # in case later commits would conflict. + for sha in reversed(commit_shas): # Specifying the path here does a few things. First, it excludes any # changes that do not touch WPT files at all. Secondly, when a file is # moved in or out of the WPT directory the filename which is outside the