diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-15 15:11:59 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-15 16:05:27 +0400 |
commit | 927dea436ee47e4dcabcde8eb4b167f0c32a08f2 (patch) | |
tree | 9e35618a41b1eb372ec9bb59d7d316909df9bb5c /source/blender/windowmanager | |
parent | 825b0e8bc422174965ed8c0376d3d25b4f923394 (diff) |
Further tweaks to buildinfo
Summary:
Old idea with changes since previous release tag
didn't work good enough. In most of the cases tag
was done in a branch hence not actually reachable
from the master branch.
Now change since release is gone, and date of
the latest commit is used instead.
The date is displayed in format YYYY-MM-DD HH:mm
in the splash.
New bpy.app fields:
- build_commit_timestamp is an unix timestamp of
the commit blender was build from.
- build_commit_date is a date of that commit.
- build_commit_time is a time of that commit.
Reviewers: campbellbarton
Differential Revision: http://developer.blender.org/D5
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ab8dac396c5..6396ef12495 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1677,24 +1677,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar #ifdef WITH_BUILDINFO int label_delta = 0; - int hash_width, change_width; - char change_buf[128] = "\0"; + int hash_width, date_width; + char date_buf[128] = "\0"; char hash_buf[128] = "\0"; - extern char build_hash[], build_change[], build_branch[]; + extern unsigned long build_commit_timestamp; + extern char build_hash[], build_commit_date[], build_commit_time[], build_branch[]; - /* TODO(sergey): As soon as we fully switched to GIT, no need to check build_hash. */ - if (build_hash[0] != '\0') { - /* Builds made from tag only shows tag sha */ - BLI_snprintf(hash_buf, sizeof(hash_buf), "Hash: %s", build_hash); - BLI_snprintf(change_buf, sizeof(change_buf), "Change: %s", build_change); - } - else { - BLI_snprintf(change_buf, sizeof(change_buf), "r%s", build_change); - } + /* Builds made from tag only shows tag sha */ + BLI_snprintf(hash_buf, sizeof(hash_buf), "Hash: %s", build_hash); + BLI_snprintf(date_buf, sizeof(date_buf), "Date: %s %s", build_commit_date, build_commit_time); BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.pixelsize * U.dpi); hash_width = (int)BLF_width(style->widgetlabel.uifont_id, hash_buf) + 0.5f * U.widget_unit; - change_width = (int)BLF_width(style->widgetlabel.uifont_id, change_buf) + 0.5f * U.widget_unit; + date_width = (int)BLF_width(style->widgetlabel.uifont_id, date_buf) + 0.5f * U.widget_unit; #endif /* WITH_BUILDINFO */ block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); @@ -1710,16 +1705,13 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); #ifdef WITH_BUILDINFO - if (!STREQ(build_change, "0")) { - uiDefBut(block, LABEL, 0, change_buf, U.pixelsize * 494 - change_width, U.pixelsize * 270, change_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + if (build_commit_timestamp != 0) { + uiDefBut(block, LABEL, 0, date_buf, U.pixelsize * 494 - date_width, U.pixelsize * 270, date_width, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); label_delta = 12; } 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); - /* TODO(sergey): As soon as we fully switched to GIT, no need to check - * whether branch is empty or not. - */ - if (build_branch[0] != '\0' && !STREQ(build_branch, "master")) { + if (!STREQ(build_branch, "master")) { char branch_buf[128] = "\0"; int branch_width; BLI_snprintf(branch_buf, sizeof(branch_buf), "Branch: %s", build_branch); |