Remove initial changelog entry creation support

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-11-22 17:48:00 +01:00
parent 8933c04e44
commit 4e574dbd43
No known key found for this signature in database
GPG key ID: BAB674E1570735EE

View file

@ -128,19 +128,11 @@ class TextChangelogFormat(ChangelogFormat):
def extract_top_version(cls, changelog_file_content): def extract_top_version(cls, changelog_file_content):
"""A version section starts with a line starting with '='.""" """A version section starts with a line starting with '='."""
m = re.search(cls._top_version_re, changelog_file_content) m = re.search(cls._top_version_re, changelog_file_content)
if m: top_version_start = m.start(1)
top_version_start = m.start(1) top_version_end = m.end(2)
top_version_end = m.end(2) top_version_title = m.group(1)
top_version_title = m.group(1) top_version_body = m.group(2)
top_version_body = m.group(2) name = re.match(cls._name_re, top_version_title).group(1)
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): if cls.is_released_version(top_version_title):
top_version_end = top_version_start top_version_end = top_version_start
top_version_title = cls._unreleased_version_text.format(name) + '\n\n' top_version_title = cls._unreleased_version_text.format(name) + '\n\n'
@ -272,10 +264,8 @@ class ChangeLog:
"""Write the changelog to the specified file. """Write the changelog to the specified file.
""" """
with open(filename, 'w', encoding='utf-8') as out: with open(filename, 'w', encoding='utf-8') as out:
if self.header: out.write(self.header)
out.write(self.header) out.write(self.top_version_title)
if self.top_version_title:
out.write(self.top_version_title)
for title, body in self.categories.items(): for title, body in self.categories.items():
if not body: if not body:
continue continue