aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2016-11-09 23:30:05 +0530
committerVishal Bhoj <vishal.bhoj@linaro.org>2016-11-09 23:32:13 +0530
commita63d040ebd6aeefe051c23d63178296a6422813f (patch)
tree052268e90295fce2b7fd0e5a6ebb192f624e24fb
parent4c023328f1797bb025a8d4b0cf9b92cd50b23782 (diff)
downloadlinaro-android-build-tools-a63d040ebd6aeefe051c23d63178296a6422813f.tar.gz
improve premerge testing of patches
Change-Id: I9ca9274aecf27154e235c43b08b8bf7418c580bd Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
-rw-r--r--build-scripts/build-android10
1 files changed, 7 insertions, 3 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index cfe4347..3c0763a 100644
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -71,16 +71,19 @@ else
repo-sync-from-mirror "${1}"
fi
- if [ -n "$GERRIT_PROJECT" ] && [ $GERRIT_EVENT_TYPE == "patchset-created" ]; then
+ if [ -n "$GERRIT_PROJECT" ] && [ $GERRIT_EVENT_TYPE == "comment-added" ]; then
if [ "$GERRIT_PROJECT" == "platform/manifest" ]; then
cd .repo/local_manifests;
git pull http://review.android.git.linaro.org/platform/manifest $GERRIT_REFSPEC
cd -
else
cd `grep -rni $GERRIT_PROJECT\" .repo/local_manifests | grep -Po 'path="\K[^"]*'`
- git pull http://review.android.git.linaro.org/$GERRIT_PROJECT $GERRIT_REFSPEC
+ if git pull http://${GERRIT_HOST}/${GERRIT_PROJECT} ${GERRIT_REFSPEC} | grep -q "Automatic merge failed"; then
+ git reset --hard
+ echo "Error: *** Error patch merge failed"
+ exit 1
cd -
- fi
+ fi
fi
if [ -n "$PATCHSETS" ]; then
@@ -88,6 +91,7 @@ else
sh ./android-patchsets/$i
done
fi
+
if [ -n "$POST_CHECKOUT_HOOK" ]; then
# if echo "$POST_CHECKOUT_HOOK" | grep -F / >/dev/null; then
# echo "Invalid POST_CHECKOUT_HOOK: $POST_CHECKOUT_HOOK"