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 :)
This commit is contained in:
2013-11-04 13:21:39 +00:00
parent d07f3f793b
commit 2010c6ad6c
15 changed files with 211 additions and 55 deletions

View File

@@ -53,7 +53,9 @@
#ifdef BUILD_DATE
extern char build_date[];
extern char build_time[];
extern char build_rev[];
extern char build_change[];
extern char build_hash[];
extern char build_branch[];
extern char build_platform[];
extern char build_type[];
extern char build_cflags[];
@@ -75,7 +77,9 @@ static PyStructSequence_Field app_info_fields[] = {
/* buildinfo */
{(char *)"build_date", (char *)"The date this blender instance was built"},
{(char *)"build_time", (char *)"The time this blender instance was built"},
{(char *)"build_revision", (char *)"The subversion revision this blender instance was built with"},
{(char *)"build_change", (char *)"The change number this blender instance was built with"},
{(char *)"build_hash", (char *)"The commit hash this blender instance was built with"},
{(char *)"build_branch", (char *)"The branch this blender instance was built from"},
{(char *)"build_platform", (char *)"The platform this blender instance was built for"},
{(char *)"build_type", (char *)"The type of build (Release, Debug)"},
{(char *)"build_cflags", (char *)"C compiler flags"},
@@ -133,7 +137,9 @@ static PyObject *make_app_info(void)
#ifdef BUILD_DATE
SetBytesItem(build_date);
SetBytesItem(build_time);
SetBytesItem(build_rev);
SetBytesItem(build_change);
SetBytesItem(build_hash);
SetBytesItem(build_branch);
SetBytesItem(build_platform);
SetBytesItem(build_type);
SetBytesItem(build_cflags);
@@ -150,6 +156,8 @@ static PyObject *make_app_info(void)
SetBytesItem("Unknown");
SetBytesItem("Unknown");
SetBytesItem("Unknown");
SetBytesItem("Unknown");
SetBytesItem("Unknown");
#endif
SetObjItem(BPY_app_ffmpeg_struct());