bin/gen_release_notes.py: do not end "features" with "None"
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Thu, 8 Dec 2022 19:05:03 +0000 (22:05 +0300)
committerEric Engestrom <eric@engestrom.ch>
Wed, 11 Jan 2023 17:44:20 +0000 (17:44 +0000)
Currently, the "New features" list unconditionally ends with a "None"
point, which makes no sense. The original author probably meant to check
whether the file is empty, so remove the else clause, and add the check
for emptiness.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit bd807eecd16eb308e121ff6d51210edee8635083)

.pick_status.json
bin/gen_release_notes.py

index a56f8a6..fd70e9f 100644 (file)
         "description": "bin/gen_release_notes.py: do not end \"features\" with \"None\"",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index 2f6750f..b323fc2 100755 (executable)
@@ -282,14 +282,12 @@ def calculate_previous_version(version: str, is_point: bool) -> str:
 
 def get_features(is_point_release: bool) -> typing.Generator[str, None, None]:
     p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / 'new_features.txt'
-    if p.exists():
+    if p.exists() and p.stat().st_size > 0:
         if is_point_release:
             print("WARNING: new features being introduced in a point release", file=sys.stderr)
         with p.open('rt') as f:
             for line in f:
                 yield line.rstrip()
-            else:
-                yield "None"
         p.unlink()
     else:
         yield "None"