From efdd9ed515ca9d70840774303c6e56cbe2f2621f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 18 Aug 2011 13:44:24 -0700 Subject: [PATCH] Update rfc.sh. blueprint ci-git-support Update rfc.sh to set topics to bp/FOO if a blueprint is mentioned in the commit message. Also update rfc.sh to handle multiple bug/bp lines gracefully (it will only use the first). Change-Id: Icb283e0ca63aa82e5d6bc3bf94f5e5b52dd37a9d Reviewed-on: https://review.openstack.org/273 Reviewed-by: Monty Taylor Tested-by: Jenkins --- tools/rfc.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/rfc.sh b/tools/rfc.sh index 35183c78df..f2fbfd2cbf 100755 --- a/tools/rfc.sh +++ b/tools/rfc.sh @@ -85,7 +85,7 @@ rebase_changes() { git fetch; - GIT_EDITOR=/bin/true git rebase -i origin/$branch; + GIT_EDITOR=/bin/true git rebase -i origin/$branch || exit $?; } @@ -106,7 +106,9 @@ main() assert_diverge; - bug=$(git show --format='%s %b' | perl -nle '/\b([Bb]ug|[Ll][Pp])\s*[#:]?\s*(\d+)/ && print "$2"') + bug=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]ug|[Ll][Pp])\s*[#:]?\s*(\d+)/) {print "$2"; exit}') + + bp=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]lue[Pp]rint|[Bb][Pp])\s*[#:]?\s*([0-9a-zA-Z-_]+)/) {print "$2"; exit}') if [ "$DRY_RUN" = 1 ]; then drier='echo -e Please use the following command to send your commits to review:\n\n' @@ -116,7 +118,11 @@ main() local_branch=`git branch | grep -Ei "\* (.*)" | cut -f2 -d' '` if [ -z "$bug" ]; then - $drier git push gerrit HEAD:refs/for/$branch/$local_branch; + if [ -z "$bp" ]; then + $drier git push gerrit HEAD:refs/for/$branch/$local_branch; + else + $drier git push gerrit HEAD:refs/for/$branch/bp/$bp; + fi else $drier git push gerrit HEAD:refs/for/$branch/bug/$bug; fi