pass title to git_diff

Instead of assuming a single title always makes sense, pass the right
value in.

Change-Id: Idb3677e5de41b6243cd3896226213897ffdcaa14
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann
2018-01-09 09:53:33 -05:00
parent 10f417f8cb
commit 0dd79f9be6

View File

@@ -98,12 +98,13 @@ def git_branch_contains(workdir, repo, title, commit):
)
def git_diff(workdir, repo, git_range, file_pattern):
def git_diff(workdir, repo, git_range, file_pattern, title=''):
repo_dir = os.path.join(workdir, repo)
files = list(glob.glob(os.path.join(repo_dir,
file_pattern)))
if files:
header('Requirements Changes %s' % git_range)
if title:
header(title)
for f in files:
cmd = [
'git', 'diff', '-U0', '--no-color',
@@ -439,8 +440,10 @@ def main():
# Show any requirements changes in the upcoming release.
# Include setup.cfg, in case the project uses "extras".
if start_range:
git_diff(workdir, project['repo'], git_range, '*requirements*.txt')
git_diff(workdir, project['repo'], git_range, 'setup.cfg')
git_diff(workdir, project['repo'], git_range, '*requirements*.txt',
'Requirements Changes %s' % git_range)
git_diff(workdir, project['repo'], git_range, 'setup.cfg',
'setup.cfg Changes %s' % git_range)
# Before we try to determine if the previous release
# is an ancestor or produce the release notes we need