Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-11-15 15:11:59 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-11-15 16:05:27 +0400
commit927dea436ee47e4dcabcde8eb4b167f0c32a08f2 (patch)
tree9e35618a41b1eb372ec9bb59d7d316909df9bb5c /build_files/cmake
parent825b0e8bc422174965ed8c0376d3d25b4f923394 (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 'build_files/cmake')
-rw-r--r--build_files/cmake/buildinfo.cmake38
1 files changed, 6 insertions, 32 deletions
diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake
index ae2f87b49be..2db03d3efe9 100644
--- a/build_files/cmake/buildinfo.cmake
+++ b/build_files/cmake/buildinfo.cmake
@@ -5,7 +5,7 @@
# with a default in case anything fails, for examble when using git-svn
set(MY_WC_HASH "")
set(MY_WC_BRANCH "")
-set(MY_WC_CHANGE "unknown")
+set(MY_WC_COMMIT_TIMESTAMP 0)
# Guess if this is a SVN working copy and then look up the revision
if(EXISTS ${SOURCE_DIR}/.git/)
@@ -29,19 +29,10 @@ if(EXISTS ${SOURCE_DIR}/.git/)
OUTPUT_VARIABLE _git_latest_version_tag
OUTPUT_STRIP_TRAILING_WHITESPACE)
- if(NOT _git_latest_version_tag STREQUAL "")
- execute_process(COMMAND git rev-list HEAD ^${_git_latest_version_tag} --count
- WORKING_DIRECTORY ${SOURCE_DIR}
- OUTPUT_VARIABLE MY_WC_CHANGE
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- else()
- # For the time being we don't have annotated release tags,
- # count all the revisions in branch.
- execute_process(COMMAND git rev-list HEAD --count
- WORKING_DIRECTORY ${SOURCE_DIR}
- OUTPUT_VARIABLE MY_WC_CHANGE
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- endif()
+ execute_process(COMMAND git log -1 --format=%ct
+ WORKING_DIRECTORY ${SOURCE_DIR}
+ OUTPUT_VARIABLE MY_WC_COMMIT_TIMESTAMP
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
# Update GIT index before getting dirty files
execute_process(COMMAND git update-index -q --refresh
@@ -61,23 +52,6 @@ if(EXISTS ${SOURCE_DIR}/.git/)
unset(_git_latest_version_tag)
endif()
endif()
-else()
- # Some crazy folks like me could have hacked git-svn chekout in a way
- # so svnversion gives proper svn revision for themm which required having
- # empty .svn folder.
- #
- # For such a crazy blokes put svn check into an else branch.
- #
- # (sergey)
- if(EXISTS ${SOURCE_DIR}/.svn/)
- # The FindSubversion.cmake module is part of the standard distribution
- include(FindSubversion)
-
- if(Subversion_FOUND)
- Subversion_WC_INFO(${SOURCE_DIR} MY)
- set(MY_WC_CHANGE "${MY_WC_REVISION}")
- endif()
- endif()
endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
@@ -94,7 +68,7 @@ endif()
# Write a file with the SVNVERSION define
file(WRITE buildinfo.h.txt
"#define BUILD_HASH \"${MY_WC_HASH}\"\n"
- "#define BUILD_CHANGE \"${MY_WC_CHANGE}\"\n"
+ "#define BUILD_COMMIT_TIMESTAMP ${MY_WC_COMMIT_TIMESTAMP}\n"
"#define BUILD_BRANCH \"${MY_WC_BRANCH}\"\n"
"#define BUILD_DATE \"${BUILD_DATE}\"\n"
"#define BUILD_TIME \"${BUILD_TIME}\"\n"