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:
authorTon Roosendaal <ton@blender.org>2006-11-27 00:17:15 +0300
committerTon Roosendaal <ton@blender.org>2006-11-27 00:17:15 +0300
commit0cd62a9298663999fb567c1e8bd6384a5105f425 (patch)
treef277433ac2400bea69afc1d6dc0988f1647804fb /source/blender/blenkernel/intern/blender.c
parentb36bafe524a8a792fe0ea72f46ead9d193fd1ee2 (diff)
NEW! Subversion control and test for future Blender binaries.
Next to the release code, a subversion number is written in the file now. This is in the chunk GLOB, which is now in beginning of file. Subversions can be used to have finer control over do_versions(), so you don't have to wait for a release to patch stuff nicely. We can also increase these subversions regularly to denote important changes. If a subversion is not 0, it's being printed in the header, so a user can also verify the state. (We might even tag cvs for it?). Next to this, a minimum version and subversion number are written too. From now on, if you change files in a way a past binary cannot read this nicely anymore, you should set these minima to the current version. This was especially added for the new mesh layers, which will not work for older binaries once we make 2.43.
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r--source/blender/blenkernel/intern/blender.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index bb5f25c6907..1b4c0bffce7 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -213,7 +213,10 @@ void initglobals(void)
G.order= 1;
G.order= (((char*)&G.order)[0])?L_ENDIAN:B_ENDIAN;
- sprintf(versionstr, "www.blender.org %d", G.version);
+ if(BLENDER_SUBVERSION)
+ sprintf(versionstr, "www.blender.org %d.%d", G.version, BLENDER_SUBVERSION);
+ else
+ sprintf(versionstr, "www.blender.org %d", G.version);
#ifdef _WIN32 // FULLSCREEN
G.windowstate = G_WINDOWSTATE_USERDEF;
@@ -411,6 +414,20 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
MEM_freeN(bfd);
}
+static void handle_subversion_warning(Main *main)
+{
+ if(main->minversionfile > BLENDER_VERSION ||
+ (main->minversionfile == BLENDER_VERSION &&
+ main->minsubversionfile > BLENDER_SUBVERSION)) {
+
+ char str[128];
+
+ sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile);
+ error(str);
+ }
+
+}
+
/* returns:
0: no load file
1: OK
@@ -433,7 +450,10 @@ int BKE_read_file(char *dir, void *type_r)
*((BlenFileType*)type_r)= bfd->type;
setup_app_data(bfd, dir);
- } else {
+
+ handle_subversion_warning(bfd->main);
+ }
+ else {
error("Loading %s failed: %s", dir, BLO_bre_as_string(bre));
}