Merge "Make list-changes smarter"
This commit is contained in:
commit
27b69ab8ad
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user