[Bf-blender-cvs] [af7a2a3] master: Fix buildinfo hash for cases there's no upstream set for the branch

Sergey Sharybin noreply at git.blender.org
Wed Nov 27 21:30:33 CET 2013


Commit: af7a2a3b6a08bdbe99d295e593e770af165eb0e6
Author: Sergey Sharybin
Date:   Thu Nov 28 02:25:09 2013 +0600
http://developer.blender.org/rBaf7a2a3b6a08bdbe99d295e593e770af165eb0e6

Fix buildinfo hash for cases there's no upstream set for the branch

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

M	build_files/cmake/buildinfo.cmake
M	build_files/scons/tools/Blender.py

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

diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake
index 9d315c2..c31a7cf 100644
--- a/build_files/cmake/buildinfo.cmake
+++ b/build_files/cmake/buildinfo.cmake
@@ -19,6 +19,15 @@ if(EXISTS ${SOURCE_DIR}/.git)
 		                OUTPUT_VARIABLE MY_WC_HASH
 		                OUTPUT_STRIP_TRAILING_WHITESPACE)
 
+		if (MY_WC_HASH STREQUAL "")
+			# Local branch, not set to upstream.
+			# Well, let's use HEAD for now
+			execute_process(COMMAND git rev-parse --short HEAD
+			                WORKING_DIRECTORY ${SOURCE_DIR}
+			                OUTPUT_VARIABLE MY_WC_HASH
+		        	        OUTPUT_STRIP_TRAILING_WHITESPACE)
+		endif()
+
 		execute_process(COMMAND git rev-parse --abbrev-ref HEAD
 		                WORKING_DIRECTORY ${SOURCE_DIR}
 		                OUTPUT_VARIABLE MY_WC_BRANCH
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index 9d1a639..0f02502 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -422,6 +422,9 @@ def buildinfo(lenv, build_type):
             build_hash = os.popen('git rev-parse --short @{u}').read().strip()
             build_branch = os.popen('git rev-parse --abbrev-ref HEAD').read().strip()
 
+            if build_hash == '':
+                build_hash = os.popen('git rev-parse --short HEAD').read().strip()
+
             # ## Check for local modifications
             has_local_changes = False




More information about the Bf-blender-cvs mailing list