move the check for the SHA to match HEAD earlier

Move the check that tells us if the SHA matches HEAD earlier, along with
the other info about the commit being tagged.

Change-Id: I2ec290ef5553036ac1baf5109aea7aa98ea97f53
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-03-03 16:32:58 -05:00
parent aa6c51cb19
commit c9b3715c82

View File

@ -190,6 +190,25 @@ def main():
ref=project['hash'],
)
head_sha = gitutils.sha_for_tag(workdir, project['repo'], 'HEAD')
requested_sha = gitutils.sha_for_tag(
workdir,
project['repo'],
project['hash'],
)
# If the sha for HEAD and the requested release don't
# match, show any unreleased changes on the branch. We ask
# git to give us the real SHA for the requested release in
# case the deliverables file has the short version of the
# hash.
header('Relationship to HEAD')
if head_sha == requested_sha:
print('\nRequest releases from HEAD on %s' % branch)
else:
git_log(workdir, project['repo'], 'Release will NOT include',
'%s..%s' % (requested_sha, head_sha),
extra_args=['--format=%h %ci %s'])
# Show any requirements changes in the upcoming release.
if start_range:
git_diff(workdir, project['repo'], git_range, '*requirements*.txt')
@ -207,24 +226,6 @@ def main():
git_range,
extra_args=['--no-merges', '--topo-order'])
# If the sha for HEAD and the requested release don't
# match, show any unreleased changes on the branch. We ask
# git to give us the real SHA for the requested release in
# case the deliverables file has the short version of the
# hash.
head_sha = gitutils.sha_for_tag(workdir, project['repo'], 'HEAD')
requested_sha = gitutils.sha_for_tag(
workdir,
project['repo'],
project['hash'],
)
if head_sha == requested_sha:
print('Request releases from HEAD on %s' % branch)
else:
git_log(workdir, project['repo'], 'Release will NOT include',
'%s..%s' % (requested_sha, head_sha),
extra_args=['--format=%h %ci %s'])
# Show any changes in the previous release but not in this
# release, in case someone picks an "early" SHA or a
# regular commit instead of the appropriate merge commit.