diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-04 17:21:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-04 17:21:39 +0400 |
commit | 2010c6ad6cae41b5f13b36339404ff60c98ae915 (patch) | |
tree | 543e34b74bf56ce9338f3ae0e029852cdd78905a /source/creator/creator.c | |
parent | d07f3f793b8c7596e36249d589aafcf63611cc1d (diff) |
Made buildinfo aware of builds from GIT
- Use commit number since last annotated tag as a
revision number replacement. It'll eb followed
by 'M' symbol if there're local modification in
the source tree.
- Commit short SHA1 is included. Helps getting
information about commit used to build blender
with much faster.
- If build is not done from master branch, this also
will be noticed in the splash screen.
This commit also replaces revision stored in the
files with git-specific fields (change and hash).
This is kind of breaks compatibility, meaning
files which were saved before this change wouldn't
display any information about which revision they
were saved with. When we'll finally switch to git,
we'll see proper hash and change number since
previous release in the files, for until then
svn version will be used as a change number and
hash will be empty.
Not a huge deal, since this field was only used
by developers to help torubleshooting things and
isn't needed for blender itself.
Some additional tweaks are probably needed :)
Diffstat (limited to 'source/creator/creator.c')
-rw-r--r-- | source/creator/creator.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 54fc80984f3..8221552a1d7 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -153,7 +153,9 @@ #ifdef BUILD_DATE extern char build_date[]; extern char build_time[]; -extern char build_rev[]; +extern char build_hash[]; +extern char build_change[]; +extern char build_branch[]; extern char build_platform[]; extern char build_type[]; extern char build_cflags[]; @@ -219,7 +221,14 @@ static int print_version(int UNUSED(argc), const char **UNUSED(argv), void *UNUS #ifdef BUILD_DATE printf("\tbuild date: %s\n", build_date); printf("\tbuild time: %s\n", build_time); - printf("\tbuild revision: %s\n", build_rev); + /* TODO(sergey): As soon as we fully switched to GIT, no need to check build_hash. */ + if (build_hash[0] != '\0') { + printf("\tbuild revision: %s\n", build_change); + } + else { + printf("\tbuild change: %s\n", build_change); + printf("\tbuild hash: %s\n", build_hash); + } printf("\tbuild platform: %s\n", build_platform); printf("\tbuild type: %s\n", build_type); printf("\tbuild c flags: %s\n", build_cflags); @@ -590,13 +599,17 @@ static void blender_crash_handler(int signum) printf("Writing: %s\n", fname); fflush(stdout); - BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG, -#ifdef BUILD_DATE - build_rev +#ifndef BUILD_DATE + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Unknown revision\n", BLEND_VERSION_ARG); #else - "Unknown" + /* TODO(sergey): As soon as we fully switched to GIT, no need to check build_hash. */ + if (build_hash[0] != '\0') { + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Change: %s, Hash %s\n", BLEND_VERSION_ARG, build_change, build_hash); + } + else { + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG, build_change); + } #endif - ); /* open the crash log */ errno = 0; |