Updates to blueprint/topics.

blueprint ci-git-support

Fix update blueprint script to link to topics with prefixes.
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: I37e878ae18f46b7789c963faebd17c7a5f05ef84
Reviewed-on: https://review.openstack.org/272
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair
2011-08-18 13:21:08 -07:00
committed by Jenkins
parent e7a910eb6c
commit 75f0ae853d
2 changed files with 15 additions and 8 deletions

View File

@@ -58,7 +58,7 @@ DB_USER = GERRIT_CONFIG.get("database", "username")
DB_PASS = SECURE_CONFIG.get("database","password")
DB_DB = GERRIT_CONFIG.get("database","database")
def update_spec(launchpad, project, name, subject, link, topic=False):
def update_spec(launchpad, project, name, subject, link, topic=None):
# For testing, if a project doesn't match openstack/foo, use
# the openstack-ci project instead.
group, project = project.split('/')
@@ -72,7 +72,7 @@ def update_spec(launchpad, project, name, subject, link, topic=False):
changed = False
if topic:
topiclink = '%s/#q,topic:%s,n,z' % (link[:link.find('/',8)],
name)
topic)
if topiclink not in wb:
wb += "\n\n\nGerrit topic: %(link)s" % dict(link=topiclink)
changed = True
@@ -99,11 +99,12 @@ def find_specs(launchpad, dbconn, args):
specs = set([m.group(2) for m in SPEC_RE.finditer(git_log)])
if topic:
topic = topic.split('/')[-1]
specs |= set([topic])
topicspec = topic.split('/')[-1]
specs |= set([topicspec])
for spec in specs:
update_spec(launchpad, args.project, spec, subject, args.change_url, spec==topic)
update_spec(launchpad, args.project, spec, subject,
args.change_url, topic)
def main():
parser = argparse.ArgumentParser()

View File

@@ -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