Mesa (staging/20.1): post_version.py: invert `is_point` into `is_first_release` to make its purpose clearer

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 18 23:00:41 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 0f2888d071fda35386585732cc26b0ab7f58b5ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f2888d071fda35386585732cc26b0ab7f58b5ba

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Thu May  7 00:19:51 2020 +0200

post_version.py: invert `is_point` into `is_first_release` to make its purpose clearer

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4929>
(cherry picked from commit ae26149e2e9ccac54d64ded9a9c0a8ae84cfd300)

---

 .pick_status.json   |  2 +-
 bin/post_version.py | 16 +++++++---------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c6903fa7174..bdecf5c0ae1 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1489,7 +1489,7 @@
         "description": "post_version.py: invert `is_point` into `is_first_release` to make its purpose clearer",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/bin/post_version.py b/bin/post_version.py
index 7ba24d8f737..446fae9880b 100755
--- a/bin/post_version.py
+++ b/bin/post_version.py
@@ -33,8 +33,8 @@ from lxml import (
 )
 
 
-def is_point_release(version: str) -> bool:
-    return not version.endswith('.0')
+def is_first_release(version: str) -> bool:
+    return version.endswith('.0')
 
 
 def is_release_candidate(version: str) -> bool:
@@ -48,7 +48,7 @@ def branch_name(version: str) -> str:
     return f'{major}.{minor}'
 
 
-def update_index(is_point: bool, version: str) -> None:
+def update_index(version: str) -> None:
     p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html'
     with p.open('rt') as f:
         tree = html.parse(f)
@@ -64,11 +64,11 @@ def update_index(is_point: bool, version: str) -> None:
     a = etree.SubElement(
         body, 'a', attrib={'href': f'relnotes/{version}.html'})
     a.text = f"Mesa {version}"
-    if is_point:
-        a.tail = " is released. This is a bug fix release."
-    else:
+    if is_first_release(version):
         a.tail = (" is released. This is a new development release. "
                   "See the release notes for more information about this release.")
+    else:
+        a.tail = " is released. This is a bug fix release."
 
     root = news.getparent()
     index = root.index(news) + 1
@@ -134,9 +134,7 @@ def main() -> None:
     parser.add_argument('version', help="The released version.")
     args = parser.parse_args()
 
-    is_point = is_point_release(args.version)
-
-    update_index(is_point, args.version)
+    update_index(args.version)
     update_release_notes(args.version)
     update_calendar(args.version)
     subprocess.run(['git', 'commit', '-m',



More information about the mesa-commit mailing list