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 /source/blender/blenloader
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 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
-rw-r--r--source/blender/blenloader/intern/writefile.c7
2 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 910ff1d9ebe..e2876317e38 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7293,7 +7293,7 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead)
bfd->main->subversionfile = fg->subversion;
bfd->main->minversionfile = fg->minversion;
bfd->main->minsubversionfile = fg->minsubversion;
- BLI_strncpy(bfd->main->build_change, fg->build_change, sizeof(bfd->main->build_change));
+ bfd->main->build_commit_timestamp = fg->build_commit_timestamp;
BLI_strncpy(bfd->main->build_hash, fg->build_hash, sizeof(bfd->main->build_hash));
bfd->winpos = fg->winpos;
@@ -7929,9 +7929,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* WATCH IT!!!: pointers from libdata have not been converted */
if (G.debug & G_DEBUG) {
- printf("read file %s\n Version %d sub %d change %s hash %s\n",
+ char build_commit_datetime[32];
+ time_t temp_time = main->build_commit_timestamp;
+ struct tm *tm = gmtime(&temp_time);
+ strftime(build_commit_datetime, sizeof(build_commit_datetime), "%Y-%m-%d %H:%M", tm);
+
+ printf("read file %s\n Version %d sub %d date %s hash %s\n",
fd->relabase, main->versionfile, main->subversionfile,
- main->build_change, main->build_hash);
+ build_commit_datetime, main->build_hash);
}
blo_do_versions_pre250(fd, lib, main);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index cf7a5329a35..1f417df38d2 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3285,13 +3285,14 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
fg.minsubversion= BLENDER_MINSUBVERSION;
#ifdef WITH_BUILDINFO
{
- extern char build_change[], build_hash[];
+ extern unsigned long build_commit_timestamp;
+ extern char build_hash[];
/* TODO(sergey): Add branch name to file as well? */
- BLI_strncpy(fg.build_change, build_change, sizeof(fg.build_change));
+ fg.build_commit_timestamp = build_commit_timestamp;
BLI_strncpy(fg.build_hash, build_hash, sizeof(fg.build_hash));
}
#else
- BLI_strncpy(fg.build_change, "unknown", sizeof(fg.build_change));
+ fg.build_commit_timestamp = 0;
BLI_strncpy(fg.build_hash, "unknown", sizeof(fg.build_hash));
#endif
writestruct(wd, GLOB, "FileGlobal", 1, &fg);