Fix authors generation from co-authored-by.

It turns out that the reasons we add tests is to run them.

Change-Id: I6212e799c1f11ffb4e9d8b15600edc4b4d885d3e
This commit is contained in:
Monty Taylor 2013-03-24 18:38:00 +01:00
parent 5b3e94254f
commit 155e64f050
2 changed files with 10 additions and 9 deletions

View File

@ -156,15 +156,6 @@ def write_git_changelog(git_dir=None, dest_dir=os.path.curdir):
if git_dir:
git_log_cmd = 'git --git-dir=%s log' % git_dir
changelog = _run_shell_command(git_log_cmd)
signed_cmd = ("git log --git-dir=" + git_dir +
" | grep -i Co-authored-by: | sort -u")
signed_entries = _run_shell_command(signed_cmd)
if signed_entries:
new_entries = "\n".join(
[signed.split(":", 1)[1].strip()
for signed in signed_entries.split("\n") if signed])
changelog = "\n".join((changelog, new_entries))
mailmap = read_git_mailmap(git_dir)
with open(new_changelog, "w") as changelog_file:
changelog_file.write(canonicalize_emails(changelog, mailmap))
@ -188,6 +179,15 @@ def generate_authors(git_dir=None, dest_dir='.'):
" log --format='%aN <%aE>' | sort -u | "
"egrep -v '" + jenkins_email + "'")
changelog = _run_shell_command(git_log_cmd)
signed_cmd = ("git log --git-dir=" + git_dir +
" | grep -i Co-authored-by: | sort -u")
signed_entries = _run_shell_command(signed_cmd)
if signed_entries:
new_entries = "\n".join(
[signed.split(":", 1)[1].strip()
for signed in signed_entries.split("\n") if signed])
changelog = "\n".join((changelog, new_entries))
mailmap = read_git_mailmap(git_dir)
with open(new_authors, 'w') as new_authors_fh:
new_authors_fh.write(canonicalize_emails(changelog, mailmap))

View File

@ -3,6 +3,7 @@ discover
fixtures>=0.3.12
flake8
mox
oslo.config
python-subunit
sphinx>=1.1.2
testrepository>=0.0.13