Skip to content
Snippets Groups Projects
Commit 91c0fc86 authored by John Swinbank's avatar John Swinbank
Browse files

Only write changelog if there is a changelog to write

parent 545161b4
Branches tickets/SDC-232
No related tags found
1 merge request!25Only write changelog if there is a changelog to write
......@@ -51,13 +51,14 @@ def get_all_tags():
def generate_change_record(tags):
output = StringIO()
output.write("\setDocChangeRecord{\n")
for tag in sorted(tags, key=lambda x: x.name, reverse=True):
if match(r"\d+\.\d+", tag.name):
output.write(f" \\addChangeRecord{{{escape_latex(tag.name)}}}")
output.write(f"{{{tag.date.strftime('%Y-%m-%d')}}}")
output.write(f"{{{escape_latex(tag.message)}}}\n")
output.write("}")
if tags:
output.write("\setDocChangeRecord{\n")
for tag in sorted(tags, key=lambda x: x.name, reverse=True):
if match(r"\d+\.\d+", tag.name):
output.write(f" \\addChangeRecord{{{escape_latex(tag.name)}}}")
output.write(f"{{{tag.date.strftime('%Y-%m-%d')}}}")
output.write(f"{{{escape_latex(tag.message)}}}\n")
output.write("}")
return output.getvalue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment