aosp-merger: Fix merged_repos.txt handling after refactor
Change-Id: I8719e4ab8ddd043eefc1e0c1dca9d427b0f0cc7e
This commit is contained in:
committed by
Chirayu Desai
parent
6fb4c9a940
commit
788196f219
@@ -48,7 +48,7 @@ PROJECTOPERATION="${OPERATION}"
|
|||||||
|
|
||||||
# Was there any change upstream? Skip if not.
|
# Was there any change upstream? Skip if not.
|
||||||
if [[ -z "$(git diff ${OLDTAG} ${NEWTAG})" ]]; then
|
if [[ -z "$(git diff ${OLDTAG} ${NEWTAG})" ]]; then
|
||||||
echo -e "nochange\t\t${PROJECTPATH}"
|
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
|
||||||
repo abandon "${STAGINGBRANCH}" .
|
repo abandon "${STAGINGBRANCH}" .
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -69,7 +69,7 @@ if [[ "${PROJECTOPERATION}" == "merge" ]]; then
|
|||||||
# Check if we've actually changed anything after the merge
|
# Check if we've actually changed anything after the merge
|
||||||
# If we haven't, just abandon the branch
|
# If we haven't, just abandon the branch
|
||||||
if [[ -z "$(git diff HEAD HEAD~1)" ]]; then
|
if [[ -z "$(git diff HEAD HEAD~1)" ]]; then
|
||||||
echo -e "nochange\t\t${PROJECTPATH}"
|
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
|
||||||
repo abandon "${STAGINGBRANCH}" .
|
repo abandon "${STAGINGBRANCH}" .
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -82,4 +82,4 @@ CONFLICT=""
|
|||||||
if [[ -n "$(git status --porcelain)" ]]; then
|
if [[ -n "$(git status --porcelain)" ]]; then
|
||||||
CONFLICT="conflict-"
|
CONFLICT="conflict-"
|
||||||
fi
|
fi
|
||||||
echo -e "${CONFLICT}${PROJECTOPERATION}\t\t${PROJECTPATH}"
|
echo -e "${CONFLICT}${PROJECTOPERATION}\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
|
||||||
|
|||||||
@@ -30,11 +30,17 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
|
|
||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
|
TOP="${script_path}/../../.."
|
||||||
|
|
||||||
## HELP MESSAGE (USAGE INFO)
|
## HELP MESSAGE (USAGE INFO)
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
### FUNCTIONS ###
|
### FUNCTIONS ###
|
||||||
|
|
||||||
|
merge_aosp() {
|
||||||
|
"${script_path}"/merge-aosp.sh merge "${aosp_tag}" "${prev_aosp_tag}"
|
||||||
|
}
|
||||||
|
|
||||||
merge_aosp_forks() {
|
merge_aosp_forks() {
|
||||||
"${script_path}"/merge-aosp-forks.sh merge "${prev_aosp_tag}" "${aosp_tag}"
|
"${script_path}"/merge-aosp-forks.sh merge "${prev_aosp_tag}" "${aosp_tag}"
|
||||||
}
|
}
|
||||||
@@ -65,12 +71,30 @@ help_message() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
if [ "$#" -eq 0 ]; then
|
||||||
|
export MERGEDREPOS="${TOP}/merged_repos.txt"
|
||||||
|
|
||||||
merge_aosp_forks
|
merge_aosp_forks
|
||||||
read -p "Waiting for conflict resolution before squashing. Press enter when done."
|
read -p "Waiting for conflict resolution before squashing. Press enter when done."
|
||||||
read -p "Once more, just to be safe"
|
read -p "Once more, just to be safe"
|
||||||
squash_aosp_merge
|
squash_aosp_merge
|
||||||
upload_squash_to_review
|
upload_squash_to_review
|
||||||
echo "Don't forget to update the manifest!"
|
echo "Don't forget to update the manifest!"
|
||||||
|
|
||||||
|
unset MERGEDREPOS
|
||||||
|
elif [ "${1}" = "aosp" ]; then
|
||||||
|
export MERGEDREPOS="${TOP}/merged_repos_aosp.txt"
|
||||||
|
|
||||||
|
merge_aosp
|
||||||
|
|
||||||
|
unset MERGEDREPOS
|
||||||
|
elif [ "${1}" = "submit-platform" ]; then
|
||||||
|
export MERGEDREPOS="${TOP}/merged_repos.txt"
|
||||||
|
|
||||||
|
push_merge
|
||||||
|
|
||||||
|
unset MERGEDREPOS
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
### RUN PROGRAM ###
|
### RUN PROGRAM ###
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
TOP="${script_path}/../../.."
|
TOP="${script_path}/../../.."
|
||||||
MERGEDREPOS="${TOP}/merged_repos.txt"
|
|
||||||
MANIFEST="${TOP}/.repo/manifests/default.xml"
|
MANIFEST="${TOP}/.repo/manifests/default.xml"
|
||||||
BRANCH="${calyxos_branch}"
|
BRANCH="${calyxos_branch}"
|
||||||
export STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
export STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
||||||
@@ -65,7 +64,7 @@ repo abandon "${STAGINGBRANCH}"
|
|||||||
|
|
||||||
# Iterate over each forked project
|
# Iterate over each forked project
|
||||||
for PROJECTPATH in ${PROJECTPATHS}; do
|
for PROJECTPATH in ${PROJECTPATHS}; do
|
||||||
"${script_path}"/_merge_helper.sh "${PROJECTPATH}" "${@}" | tee -a "${MERGEDREPOS}"
|
"${script_path}"/_merge_helper.sh "${PROJECTPATH}" "${@}"
|
||||||
done
|
done
|
||||||
|
|
||||||
unset STAGINGBRANCH
|
unset STAGINGBRANCH
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
TOP="${script_path}/../../.."
|
TOP="${script_path}/../../.."
|
||||||
MERGEDREPOS="${TOP}/merged_repos_aosp.txt"
|
|
||||||
MANIFEST="${TOP}/.repo/manifests/default.xml"
|
MANIFEST="${TOP}/.repo/manifests/default.xml"
|
||||||
export STAGINGBRANCH="staging/${OLDTAG}_${OPERATION}-${NEWTAG}"
|
export STAGINGBRANCH="staging/${OLDTAG}_${OPERATION}-${NEWTAG}"
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ repo abandon "${STAGINGBRANCH}"
|
|||||||
|
|
||||||
# Iterate over each forked project
|
# Iterate over each forked project
|
||||||
for PROJECTPATH in ${PROJECTPATHS}; do
|
for PROJECTPATH in ${PROJECTPATHS}; do
|
||||||
"${script_path}"/_merge_helper.sh "${PROJECTPATH}" "${@}" | tee -a "${MERGEDREPOS}"
|
"${script_path}"/_merge_helper.sh "${PROJECTPATH}" "${@}"
|
||||||
done
|
done
|
||||||
|
|
||||||
unset STAGINGBRANCH
|
unset STAGINGBRANCH
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
TOP="${script_path}/../../.."
|
TOP="${script_path}/../../.."
|
||||||
MERGEDREPOS="${TOP}/merged_repos.txt"
|
|
||||||
BRANCH="${calyxos_branch}"
|
BRANCH="${calyxos_branch}"
|
||||||
STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
TOP="${script_path}/../../.."
|
TOP="${script_path}/../../.."
|
||||||
MERGEDREPOS="${TOP}/merged_repos.txt"
|
|
||||||
BRANCH="${calyxos_branch}"
|
BRANCH="${calyxos_branch}"
|
||||||
STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
STAGINGBRANCH="staging/${BRANCH}_${OPERATION}-${NEWTAG}"
|
||||||
SQUASHBRANCH="squash/${BRANCH}_${OPERATION}-${NEWTAG}"
|
SQUASHBRANCH="squash/${BRANCH}_${OPERATION}-${NEWTAG}"
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ readonly vars_path="${script_path}/../vars"
|
|||||||
source "${vars_path}/common"
|
source "${vars_path}/common"
|
||||||
|
|
||||||
TOP="${script_path}/../../.."
|
TOP="${script_path}/../../.."
|
||||||
MERGEDREPOS="${TOP}/merged_repos.txt"
|
|
||||||
BRANCH="${calyxos_branch}"
|
BRANCH="${calyxos_branch}"
|
||||||
SQUASHBRANCH="squash/${BRANCH}_${OPERATION}-${NEWTAG}"
|
SQUASHBRANCH="squash/${BRANCH}_${OPERATION}-${NEWTAG}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user