summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-13 17:32:21 +0000
committerGerrit Code Review <review@openstack.org>2012-07-13 17:32:21 +0000
commit51f5a233aeff9fc5fac34ff10a906d5f62ccd6b6 (patch)
tree6747c5bf10e90ec3b6a97f87d65fc96b5dbd56cd /nova/openstack
parente656cc8a92cf340e0b8b7f21d633280aff2d4f55 (diff)
parent12a89225e30d2b31854be387b78cd60a15446163 (diff)
downloadnova-51f5a233aeff9fc5fac34ff10a906d5f62ccd6b6.tar.gz
nova-51f5a233aeff9fc5fac34ff10a906d5f62ccd6b6.tar.xz
nova-51f5a233aeff9fc5fac34ff10a906d5f62ccd6b6.zip
Merge "Add SKIP_WRITE_GIT_CHANGELOG to setup.py."
Diffstat (limited to 'nova/openstack')
-rw-r--r--nova/openstack/common/setup.py42
1 files changed, 25 insertions, 17 deletions
diff --git a/nova/openstack/common/setup.py b/nova/openstack/common/setup.py
index 2be72e61a..59f255d0c 100644
--- a/nova/openstack/common/setup.py
+++ b/nova/openstack/common/setup.py
@@ -178,12 +178,16 @@ def _get_git_post_version():
def write_git_changelog():
"""Write a changelog based on the git changelog."""
- if os.path.isdir('.git'):
- git_log_cmd = 'git log --stat'
- changelog = _run_shell_command(git_log_cmd)
- mailmap = parse_mailmap()
- with open("ChangeLog", "w") as changelog_file:
- changelog_file.write(canonicalize_emails(changelog, mailmap))
+ new_changelog = 'ChangeLog'
+ if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'):
+ if os.path.isdir('.git'):
+ git_log_cmd = 'git log --stat'
+ changelog = _run_shell_command(git_log_cmd)
+ mailmap = parse_mailmap()
+ with open(new_changelog, "w") as changelog_file:
+ changelog_file.write(canonicalize_emails(changelog, mailmap))
+ else:
+ open(new_changelog, 'w').close()
def generate_authors():
@@ -191,17 +195,21 @@ def generate_authors():
jenkins_email = 'jenkins@review.openstack.org'
old_authors = 'AUTHORS.in'
new_authors = 'AUTHORS'
- if os.path.isdir('.git'):
- # don't include jenkins email address in AUTHORS file
- git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
- "grep -v " + jenkins_email)
- changelog = _run_shell_command(git_log_cmd)
- mailmap = parse_mailmap()
- with open(new_authors, 'w') as new_authors_fh:
- new_authors_fh.write(canonicalize_emails(changelog, mailmap))
- if os.path.exists(old_authors):
- with open(old_authors, "r") as old_authors_fh:
- new_authors_fh.write('\n' + old_authors_fh.read())
+ if not os.getenv('SKIP_GENERATE_AUTHORS'):
+ if os.path.isdir('.git'):
+ # don't include jenkins email address in AUTHORS file
+ git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
+ "grep -v " + jenkins_email)
+ changelog = _run_shell_command(git_log_cmd)
+ mailmap = parse_mailmap()
+ with open(new_authors, 'w') as new_authors_fh:
+ new_authors_fh.write(canonicalize_emails(changelog, mailmap))
+ if os.path.exists(old_authors):
+ with open(old_authors, "r") as old_authors_fh:
+ new_authors_fh.write('\n' + old_authors_fh.read())
+ else:
+ open(new_authors, 'w').close()
+
_rst_template = """%(heading)s
%(underline)s