post_version.py: fix relnotes links
authorEric Engestrom <eric@engestrom.ch>
Wed, 15 Jul 2020 21:53:59 +0000 (23:53 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jul 2020 21:51:24 +0000 (21:51 +0000)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5928>

bin/post_version.py

index 328a48b26049021b8d59125019b3c4c6dd4816ab..359cbd9012cc177fb5428eddbac9f4d20abaf01f 100755 (executable)
@@ -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: