tweaks to buildinfo
We wouldn't really have release branches, building will happen from annotated tags. Made it so building tag revision equals to a master branch.
This commit is contained in:
@@ -35,8 +35,26 @@ if(EXISTS ${SOURCE_DIR}/.git)
|
|||||||
STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}")
|
STRING(REGEX REPLACE "^[ \t]+" "" _git_contains_check "${_git_contains_check}")
|
||||||
if(_git_contains_check STREQUAL "master")
|
if(_git_contains_check STREQUAL "master")
|
||||||
set(MY_WC_BRANCH "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()
|
endif()
|
||||||
|
|
||||||
|
unset(_git_tag_hashes)
|
||||||
|
unset(_git_head_hashs)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
unset(_git_contains_check)
|
unset(_git_contains_check)
|
||||||
else()
|
else()
|
||||||
execute_process(COMMAND git log HEAD..@{u}
|
execute_process(COMMAND git log HEAD..@{u}
|
||||||
|
@@ -430,6 +430,11 @@ def buildinfo(lenv, build_type):
|
|||||||
master_check = os.popen('git branch --list master --contains ' + build_hash).read().strip()
|
master_check = os.popen('git branch --list master --contains ' + build_hash).read().strip()
|
||||||
if master_check == 'master':
|
if master_check == 'master':
|
||||||
build_branch = '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 == '':
|
if build_hash == '':
|
||||||
build_hash = os.popen('git rev-parse --short HEAD').read().strip()
|
build_hash = os.popen('git rev-parse --short HEAD').read().strip()
|
||||||
|
@@ -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);
|
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";
|
char branch_buf[128] = "\0";
|
||||||
int branch_width;
|
int branch_width;
|
||||||
BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch);
|
BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch);
|
||||||
|
Reference in New Issue
Block a user