Move changelog writing to openstack.common.

Change-Id: I8627efcc1ee74fa62d1dd1b5dc419c3c031d0175
This commit is contained in:
Monty Taylor 2012-02-07 10:06:49 -08:00
parent 73b5726559
commit a5b116b6fb
2 changed files with 11 additions and 10 deletions

View File

@ -110,3 +110,12 @@ version_info = {
'revno': %s
}
""" % (branch_nick, revid, revno))
def write_git_changelog():
if os.path.isdir('.git'):
git_log_gnu = 'git log --format="%ai %aN %n%n%x09* %s%d%n"'
changelog = run_git_command(git_log_gnu)
mailmap = parse_mailmap()
with open("ChangeLog", "w") as changelog_file:
changelog_file.write(str_dict_replace(changelog, mailmap))

View File

@ -26,12 +26,11 @@ from setuptools import setup
gettext.install('melange', unicode=1)
from melange.openstack.common.setup import parse_mailmap, str_dict_replace
from melange.openstack.common.setup import parse_requirements
from melange.openstack.common.setup import parse_dependency_links
from melange.openstack.common.setup import write_requirements
from melange.openstack.common.setup import write_vcsversion
from melange.openstack.common.setup import run_git_command
from melange.openstack.common.setup import write_git_changelog
from melange import version
@ -39,15 +38,8 @@ from melange import version
class local_sdist(sdist):
"""Customized sdist hook - builds the ChangeLog file from VC first"""
def run(self):
if os.path.isdir('.git'):
git_log_gnu = 'git log --format="%ai %aN %n%n%x09* %s%d%n"'
changelog = run_git_command(git_log_gnu)
mailmap = parse_mailmap()
with open("ChangeLog", "w") as changelog_file:
changelog_file.write(str_dict_replace(changelog, mailmap))
write_git_changelog()
sdist.run(self)
cmdclass = {'sdist': local_sdist}