Merge "Make list-changes smarter"

This commit is contained in:
Jenkins 2015-08-24 21:28:52 +00:00 committed by Gerrit Code Review
commit 27b69ab8ad
2 changed files with 22 additions and 7 deletions
openstack_releases

@ -109,12 +109,6 @@ def main():
(project['repo'], new_release['version']))
continue
if previous_release:
git_range = '%s..%s' % (previous_release['version'],
project['hash'])
else:
git_range = project['hash']
# Check out the code.
subprocess.check_call(
['zuul-cloner',
@ -125,9 +119,23 @@ def main():
]
)
start_range = previous_release
if not start_range:
start_range = (
gitutils.get_latest_tag(workdir, project['repo'])
or
None
)
if start_range:
git_range = '%s..%s' % (start_range, project['hash'])
else:
git_range = project['hash']
# Show the changes since the last release.
git_log(workdir, project['repo'],
'Release will include', git_range)
'Release %s will include' % new_release['version'],
git_range)
# If the sha for HEAD and the requested release don't
# match, show any unreleased changes on the branch. We ask

@ -87,3 +87,10 @@ def check_ancestry(workdir, repo, old_version, sha):
cwd=os.path.join(workdir, repo),
).strip()
return bool(ancestors)
def get_latest_tag(workdir, repo):
return subprocess.check_output(
['git', 'describe', '--abbrev=0'],
cwd=os.path.join(workdir, repo),
).strip()