Make empty changelog fatal error

The prep_doc_mr.py script of the bind9-qa repo needs a way to know that
gitchangelog.py did not produce entries. In the case of release notes,
it dies with "No commits matching given revlist". For changelog entries
it used to warn about "Empty changelog", but did not return non-zero
exit code.
This commit is contained in:
Michal Nowak
2025-06-18 09:52:37 +02:00
parent 5b591c74dc
commit 4d0ae4068f

View File

@@ -1889,8 +1889,7 @@ def changelog(
try:
first_version = next(versions)
except StopIteration:
warn("Empty changelog. No commits were elected to be used as entry.")
data["versions"] = []
die("Empty changelog. No commits were elected to be used as entry.")
else:
data["versions"] = itertools.chain([first_version], versions)