diff options
-rw-r--r-- | build_files/cmake/buildinfo.cmake | 18 | ||||
-rw-r--r-- | build_files/scons/tools/Blender.py | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake index 48e03ed869b..c1d21c413dc 100644 --- a/build_files/cmake/buildinfo.cmake +++ b/build_files/cmake/buildinfo.cmake @@ -35,8 +35,26 @@ if(EXISTS ${SOURCE_DIR}/.git) STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}") if(_git_contains_check STREQUAL "master") set(MY_WC_BRANCH "master") + else() + execute_process(COMMAND git show-ref --tags -d + WORKING_DIRECTORY ${SOURCE_DIR} + OUTPUT_VARIABLE _git_tag_hashes + OUTPUT_STRIP_TRAILING_WHITESPACE) + + execute_process(COMMAND git rev-parse HEAD + WORKING_DIRECTORY ${SOURCE_DIR} + OUTPUT_VARIABLE _git_head_hash + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(_git_tag_hashes MATCHES "${_git_head_hash}") + set(MY_WC_BRANCH "master") + endif() + + unset(_git_tag_hashes) + unset(_git_head_hashs) endif() + unset(_git_contains_check) else() execute_process(COMMAND git log HEAD..@{u} diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index fc4121a5934..4ceadc7b0a4 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -430,6 +430,11 @@ def buildinfo(lenv, build_type): master_check = os.popen('git branch --list master --contains ' + build_hash).read().strip() if master_check == 'master': build_branch = 'master' + else: + head_hash = os.popen('git rev-parse HEAD').read().strip() + tag_hashes = os.popen('git show-ref --tags -d').read() + if tag_hashes.find(head_hash) != -1: + build_branch = 'master' if build_hash == '': build_hash = os.popen('git rev-parse --short HEAD').read().strip() diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b063a8883a0..29ba7b09e5c 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1841,7 +1841,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar } uiDefBut(block, LABEL, 0, hash_buf, U.pixelsize * 494 - hash_width, U.pixelsize * (270 - label_delta), hash_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); - if (!STREQ(build_branch, "master") && !strstr(build_branch, "release")) { + if (!STREQ(build_branch, "master")) { char branch_buf[128] = "\0"; int branch_width; BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch); |