Mesa (staging/20.1): post_version.py: fix branch name construction for release candidates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 14 16:43:12 UTC 2020


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

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

post_version.py: fix branch name construction for release candidates

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2870
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 5fba85bcb8bcb722e0bbaa54163d8a39d6fd067d)

---

 .pick_status.json   |  2 +-
 bin/post_version.py | 15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 589650e391c..e9bd44bb58f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -472,7 +472,7 @@
         "description": "post_version.py: fix branch name construction for release candidates",
         "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 e05d177fe59..7ba24d8f737 100755
--- a/bin/post_version.py
+++ b/bin/post_version.py
@@ -37,6 +37,17 @@ def is_point_release(version: str) -> bool:
     return not version.endswith('.0')
 
 
+def is_release_candidate(version: str) -> bool:
+    return '-rc' in version
+
+
+def branch_name(version: str) -> str:
+    if is_release_candidate(version):
+        version = version.split('-')[0]
+    (major, minor, _) = version.split('.')
+    return f'{major}.{minor}'
+
+
 def update_index(is_point: bool, version: str) -> None:
     p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html'
     with p.open('rt') as f:
@@ -89,7 +100,7 @@ def update_calendar(version: str) -> None:
     with p.open('rt') as f:
         tree = html.parse(f)
 
-    base_version = version[:-2]
+    branch = branch_name(version)
 
     old = None
     new = None
@@ -100,7 +111,7 @@ def update_calendar(version: str) -> None:
             break
 
         for td in tr.xpath('./td'):
-            if td.text == base_version:
+            if td.text == branch:
                 old = tr
                 break
 



More information about the mesa-commit mailing list