[Bf-blender-cvs] [e57a1bb86be] blender-v2.79b-release: API generating script: give better version for releases builds.

Bastien Montagne noreply at git.blender.org
Mon Mar 19 11:37:48 CET 2018


Commit: e57a1bb86be2aa2144fc44d4531c2956c36791d6
Author: Bastien Montagne
Date:   Tue Mar 13 19:49:39 2018 +0100
Branches: blender-v2.79b-release
https://developer.blender.org/rBe57a1bb86be2aa2144fc44d4531c2956c36791d6

API generating script: give better version for releases builds.

Was giving '2.62.1 <sha1>' even for releases, now rather giving nicer
'2.62a <sha1>' in that case.

===================================================================

M	doc/python_api/sphinx_doc_gen.py

===================================================================

diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 7ad3bab1557..1827f809bc5 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -417,19 +417,28 @@ MODULE_GROUPING = {
 # -------------------------------BLENDER----------------------------------------
 
 blender_version_strings = [str(v) for v in bpy.app.version]
+is_release = bpy.app.version_cycle in {"rc", "release"}
 
 # converting bytes to strings, due to T30154
 BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
 BLENDER_DATE = str(bpy.app.build_date, 'utf_8')
 
-BLENDER_VERSION_DOTS = ".".join(blender_version_strings)    # '2.62.1'
+if is_release:
+    # '2.62a'
+    BLENDER_VERSION_DOTS = ".".join(blender_version_strings[:2]) + bpy.app.version_char
+else:
+    # '2.62.1'
+    BLENDER_VERSION_DOTS = ".".join(blender_version_strings)
 if BLENDER_REVISION != "Unknown":
-    BLENDER_VERSION_DOTS += " " + BLENDER_REVISION          # '2.62.1 SHA1'
+    # '2.62a SHA1' (release) or '2.62.1 SHA1' (non-release)
+    BLENDER_VERSION_DOTS += " " + BLENDER_REVISION          
 
-BLENDER_VERSION_PATH = "_".join(blender_version_strings)    # '2_62_1'
-if bpy.app.version_cycle in {"rc", "release"}:
+if is_release:
     # '2_62a_release'
     BLENDER_VERSION_PATH = "%s%s_release" % ("_".join(blender_version_strings[:2]), bpy.app.version_char)
+else:
+    # '2_62_1'
+    BLENDER_VERSION_PATH = "_".join(blender_version_strings)
 
 # --------------------------DOWNLOADABLE FILES----------------------------------



More information about the Bf-blender-cvs mailing list