Changeset View
Changeset View
Standalone View
Standalone View
contrib/source-control-tools/land-patch.sh
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
"${TOPLEVEL}"/contrib/source-control-tools/check-revision-accepted.sh "${REVISION}" | "${TOPLEVEL}"/contrib/source-control-tools/check-revision-accepted.sh "${REVISION}" | ||||
# IMPORTANT NOTE: The patch is trusted past this point because it has been reviewed | # IMPORTANT NOTE: The patch is trusted past this point because it has been reviewed | ||||
# and accepted. That includes any changes that may affect this script. | # and accepted. That includes any changes that may affect this script. | ||||
# shellcheck source=sanitize-conduit-token.sh | # shellcheck source=sanitize-conduit-token.sh | ||||
source "${TOPLEVEL}"/contrib/source-control-tools/sanitize-conduit-token.sh | source "${TOPLEVEL}"/contrib/source-control-tools/sanitize-conduit-token.sh | ||||
DEVTOOLS_DIR="${TOPLEVEL}"/contrib/devtools | |||||
BUILD_DIR="${TOPLEVEL}"/build | |||||
mkdir -p "${BUILD_DIR}" | |||||
export BUILD_DIR | |||||
# Applying brace expansion ensures the remainder of this script is loaded into memory, | |||||
# as most versions of bash typically load scripts in chunks as they run. For patches | |||||
# that alter this script, this prevents those changes from affecting the remainder of | |||||
# the execution. | |||||
{ | |||||
# Pull the patch from Phabricator and rebase it on latest master | # Pull the patch from Phabricator and rebase it on latest master | ||||
"${TOPLEVEL}"/contrib/source-control-tools/autopatch.sh --revision "${REVISION}" | "${TOPLEVEL}"/contrib/source-control-tools/autopatch.sh --revision "${REVISION}" | ||||
# TODO: Autogen (such as manpages, updating timings.json, copyright header, etc.) | # TODO: Autogen (such as manpages, updating timings.json, copyright header, etc.) | ||||
# Sanity checks | # Sanity checks | ||||
"${DEVTOOLS_DIR}"/smoke-tests.sh | "${TOPLEVEL}"/contrib/devtools/smoke-tests.sh | ||||
echo "Landing revision '${REVISION}' with arcanist arguments: ${ARC_LAND_ARGS[*]}" | echo "Landing revision '${REVISION}' with arcanist arguments: ${ARC_LAND_ARGS[*]}" | ||||
# Stop logging verbosely to prevent leaking CONDUIT_TOKEN | # Stop logging verbosely to prevent leaking CONDUIT_TOKEN | ||||
set +x | set +x | ||||
# Land a commit using arcanist. This ensures the diff is reviewed and closed properly. | # Land a commit using arcanist. This ensures the diff is reviewed and closed properly. | ||||
: | arc land "${ARC_LAND_ARGS[@]}" --revision "${REVISION}" --conduit-token "${CONDUIT_TOKEN}" | : | arc land "${ARC_LAND_ARGS[@]}" --revision "${REVISION}" --conduit-token "${CONDUIT_TOKEN}" | ||||
set -x | set -x | ||||
# This MUST be the last line to ensure no changes to this script on-disk can affect the execution | |||||
# that is running right now. See note above for more details. | |||||
exit 0 | |||||
} |