From 8250dda0fd991ad828c24885c5f82d7aa7489ed2 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 17 Oct 2013 16:10:16 -0700 Subject: [PATCH] Check diff against existing req proposal changes. * modules/jenkins/files/slave_scripts/propose_requirements_update.sh: Previously this script updated requirements against tip of master and attempted to push that to Gerrit. In the event where there is no diff between requirements changes to tip of master and an existing requirements proposal change the script will fail. Now if there is an existing change check it out and use that as the base for the changes, this allows us to check for diffs against the existing change. Change-Id: I38958c1eafc12fb54a28f5d5ba22821b06cbe70a --- .../slave_scripts/propose_requirements_update.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh index 38b871017c..c48d289119 100755 --- a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh +++ b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh @@ -23,6 +23,7 @@ git config gitreview.username $USERNAME for PROJECT in $(cat projects.txt); do + change_id="" # See if there is an open change in the openstack/requirements topic # If so, get the change id for the existing change for use in the # commit msg. @@ -47,15 +48,20 @@ EOF COMMIT_MSG=$INITIAL_COMMIT_MSG fi - rm -rf $(basename $PROJECT) - git clone --depth=1 ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git - PROJECT_DIR=$(basename $PROJECT) - python update.py $PROJECT_DIR + rm -rf $PROJECT_DIR + git clone --depth=1 ssh://$USERNAME@review.openstack.org:29418/$PROJECT.git pushd $PROJECT_DIR git review -s + if [ -n "$change_id" ] ; then + git review -d $change_id + fi + popd + python update.py $PROJECT_DIR + + pushd $PROJECT_DIR if ! git diff --quiet ; then # Commit and review git commit -a -F- <