From 3931910460405488a16359d9ab24a3b75ff94044 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Thu, 29 Jan 2015 15:07:58 -0800 Subject: [PATCH] HBASE-12944 Support patches to branches in precommit jenkins build (ADDENDUM to fix the script) --- dev-support/test-patch.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index e1e6698e37d..bacf22c3df8 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -201,13 +201,6 @@ checkout () { fi fi echo - else - if [[ $BRANCH_NAME -ne "master" ]]; then - echo "${GIT} checkout ${BRANCH_NAME}" - ${GIT} checkout ${BRANCH_NAME} - echo "${GIT} status" - ${GIT} status - fi fi return $? } @@ -223,6 +216,26 @@ findBranchNameFromPatchName() { return 0 } +checkoutBranch() { + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Testing patch on branch ${BRANCH_NAME}." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + if [[ $JENKINS == "true" ]] ; then + if [[ $BRANCH_NAME -ne "master" ]]; then + echo "${GIT} checkout ${BRANCH_NAME}" + ${GIT} checkout ${BRANCH_NAME} + echo "${GIT} status" + ${GIT} status + fi + fi +} + ############################################################################### setup () { ### Download latest patch file (ignoring .htm and .html) when run from patch process @@ -247,6 +260,7 @@ setup () { $WGET -q -O $PATCH_DIR/patch $patchURL VERSION=${GIT_COMMIT}_${defect}_PATCH-${patchNum} findBranchNameFromPatchName ${relativePatchURL} + checkoutBranch JIRA_COMMENT="Here are the results of testing the latest attachment $patchURL against ${BRANCH_NAME} branch at commit ${GIT_COMMIT}.