Skip to content

Commit

Permalink
different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Apr 6, 2020
1 parent 3c2acc0 commit 96e9747
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 58 deletions.
42 changes: 15 additions & 27 deletions .circleci/config.yml
Expand Up @@ -217,33 +217,21 @@ step-gclient-sync: &step-gclient-sync
$GCLIENT_EXTRA_ARGS \
"$CIRCLE_REPOSITORY_URL"
if ! gclient sync --with_branch_heads --with_tags; then
python src/electron/script/reset_patched_repos.py
if ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync -f --with_branch_heads --with_tags; then
# Re-export all the new patches now that they've been nicely 3-way
# merged
python src/electron/script/export_all_patches.py src/electron/patches/config.json
# Make a git commit with the updated patches
git -C src/electron add patches
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="anonymous@electronjs.org" git commit -m "update patches" --author="Electron Bot <anonymous@electronjs.org>"
# Export it
mkdir -p patches
git -C src/electron am -1 --stdout --keep-subject --no-stat --full-index > patches/update-patches.patch
# Upload it to artifacts
echo
echo "======================================================================"
echo "Sync failed with non-3way patch application, but succeeded with 3way."
echo "Check the CI artifacts for a patch you can apply to fix it."
echo "======================================================================"
echo
else
echo
echo "======================================================================"
echo "Sync failed even with 3way patch application. You'll need to resolve"
echo "this conflict locally."
echo "======================================================================"
echo
fi
ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
# Re-export all the patches to check if there were changes.
python src/electron/script/export_all_patches.py src/electron/patches/config.json
if ! git diff-index --quiet HEAD --; then
# There are changes to the patches. Make a git commit with the updated patches
git -C src/electron add patches
GIT_COMMITTER_NAME="Electron Bot" GIT_COMMITTER_EMAIL="anonymous@electronjs.org" git commit -m "update patches" --author="Electron Bot <anonymous@electronjs.org>"
# Export it
mkdir -p patches
git -C src/electron am -1 --stdout --keep-subject --no-stat --full-index > patches/update-patches.patch
echo
echo "======================================================================"
echo "There were changes to the patches when applying."
echo "Check the CI artifacts for a patch you can apply to fix it."
echo "======================================================================"
exit 1
fi
fi
Expand Down
31 changes: 0 additions & 31 deletions script/reset_patched_repos.py

This file was deleted.

0 comments on commit 96e9747

Please sign in to comment.