From eeda395897e6adbb80368ff7f413d028feb487fc Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 5 Oct 2013 08:53:51 -0700 Subject: [PATCH] Improve fallback to master branch If a change to a stable branch follows a change to the master branch but a project does not have a stable branch, the workspace setup falls back to checking out the master branch. However, it checks out the actual current master branch rather than the proposed future state of the master branch as determined by Zuul. This change will cause d-g to look for a Zuul ref for the master branch if it decides to fall back. Change-Id: Idadb0e0c4cd9cb120ec2c55f16282fc66076a61d --- devstack-vm-gate-wrap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 2110b0b8..98e86362 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -110,6 +110,7 @@ function setup_workspace { # See if this project has this branch, if not, use master if ! git branch -a |grep remotes/origin/$BRANCH>/dev/null; then BRANCH=master + FALLBACK_ZUUL_REF=$(echo $ZUUL_REF | sed -e "s,$ZUUL_BRANCH,master,") fi # See if we should check out a Zuul ref @@ -118,7 +119,9 @@ function setup_workspace { if { [ "$OVERRIDE_ZUUL_REF" != "" ] && \ git fetch $ZUUL_URL/$PROJECT $OVERRIDE_ZUUL_REF ; } || \ { [ "$ZUUL_REF" != "" ] && \ - git fetch $ZUUL_URL/$PROJECT $ZUUL_REF ; }; then + git fetch $ZUUL_URL/$PROJECT $ZUUL_REF ; } || \ + { [ "$FALLBACK_ZUUL_REF" != "" ] && \ + git fetch $ZUUL_URL/$PROJECT $FALLBACK_ZUUL_REF ; }; then # It's there, so check it out. git checkout FETCH_HEAD git reset --hard FETCH_HEAD