From 29a17811e2bc8223fb82421228cd844d22c3f146 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 16 Feb 2017 12:12:11 -0500 Subject: [PATCH] compare tag location with head of its branch Instead of assuming the master branch, use the actual branch containing the tag when looking for unreleased changes. This makes the list-changes report more useful release candidates on a stable branch during the period when the default series has not been changed (so releases on stable/a show the right info when the default branch is not b). Change-Id: I0b5857cce27cd021c59bafe26abfb471f1899311 Signed-off-by: Doug Hellmann --- openstack_releases/cmds/list_changes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openstack_releases/cmds/list_changes.py b/openstack_releases/cmds/list_changes.py index fb9cee736d..0c732065d6 100644 --- a/openstack_releases/cmds/list_changes.py +++ b/openstack_releases/cmds/list_changes.py @@ -307,13 +307,16 @@ def main(): ) print('HEAD of {} is {}'.format(tag_branch, head_sha)) else: + if branch in branches: + tag_branch = branch + else: + tag_branch = branches[0] head_sha = gitutils.sha_for_tag( workdir, project['repo'], - 'HEAD', + tag_branch, ) - print('HEAD of {} is {}'.format(branch, head_sha)) - tag_branch = branch + print('HEAD of {} is {}'.format(tag_branch, head_sha)) requested_sha = gitutils.sha_for_tag( workdir, project['repo'],