mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-30 15:32:58 +00:00
Enable to specify the name of the project in the changelog
The name read out from the previous entry. Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
parent
ddffa10264
commit
8933c04e44
7
scripts/assemble_changelog.py
Normal file → Executable file
7
scripts/assemble_changelog.py
Normal file → Executable file
@ -115,7 +115,7 @@ class ChangelogFormat:
|
||||
class TextChangelogFormat(ChangelogFormat):
|
||||
"""The traditional Mbed TLS changelog format."""
|
||||
|
||||
_unreleased_version_text = '= Mbed TLS x.x.x branch released xxxx-xx-xx'
|
||||
_unreleased_version_text = '= {} x.x.x branch released xxxx-xx-xx'
|
||||
@classmethod
|
||||
def is_released_version(cls, title):
|
||||
# Look for an incomplete release date
|
||||
@ -123,6 +123,7 @@ class TextChangelogFormat(ChangelogFormat):
|
||||
|
||||
_top_version_re = re.compile(r'(?:\A|\n)(=[^\n]*\n+)(.*?\n)(?:=|$)',
|
||||
re.DOTALL)
|
||||
_name_re = re.compile(r'=\s(.*)\s[0-9x]+\.', re.DOTALL)
|
||||
@classmethod
|
||||
def extract_top_version(cls, changelog_file_content):
|
||||
"""A version section starts with a line starting with '='."""
|
||||
@ -132,15 +133,17 @@ class TextChangelogFormat(ChangelogFormat):
|
||||
top_version_end = m.end(2)
|
||||
top_version_title = m.group(1)
|
||||
top_version_body = m.group(2)
|
||||
name = re.match(cls._name_re, top_version_title).group(1)
|
||||
# No entries found
|
||||
else:
|
||||
top_version_start = None
|
||||
top_version_end = None
|
||||
name = 'xxx'
|
||||
top_version_title = ''
|
||||
top_version_body = ''
|
||||
if cls.is_released_version(top_version_title):
|
||||
top_version_end = top_version_start
|
||||
top_version_title = cls._unreleased_version_text + '\n\n'
|
||||
top_version_title = cls._unreleased_version_text.format(name) + '\n\n'
|
||||
top_version_body = ''
|
||||
return (changelog_file_content[:top_version_start],
|
||||
top_version_title, top_version_body,
|
||||
|
Loading…
x
Reference in New Issue
Block a user