post_version.py: fix relnotes links

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5928>
This commit is contained in:
Eric Engestrom 2020-07-15 23:53:59 +02:00 committed by Marge Bot
parent 6c4ad62723
commit 5f649be7b5
1 changed files with 5 additions and 1 deletions

View File

@ -34,10 +34,14 @@ def update_release_notes(version: str) -> None:
new_relnotes = []
first_list = True
second_list = True
for line in relnotes:
if first_list and line.startswith('-'):
first_list = False
new_relnotes.append(f'- `{version} release notes <relnotes/{version}.rst>`__\n')
new_relnotes.append(f'- :doc:`{version} release notes <relnotes/{version}>`\n')
if not first_list and second_list and line.startswith(' relnotes/'):
second_list = False
new_relnotes.append(f' relnotes/{version}\n')
new_relnotes.append(line)
with open(p, 'w') as f: