diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-20 06:45:12 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-20 06:45:12 -0700 |
commit | de35c886837016c80fc65043d8a2f0b373efec5b (patch) | |
tree | 87eaf634a88f557d88d9580d5b5ad759f9e1ceeb /load-git.c | |
parent | 70d4421cd0ab235ee4f37ed7f8b6ad863da703bb (diff) | |
download | subsurface-de35c886837016c80fc65043d8a2f0b373efec5b.tar.gz |
Track minimum datafile version
Add infrastructure and helper functions to track minimum datafile version.
To make this information useful we need to keep the XML and git data
format versions in track moving forward.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'load-git.c')
-rw-r--r-- | load-git.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/load-git.c b/load-git.c index 6a054e887..6cf62ec79 100644 --- a/load-git.c +++ b/load-git.c @@ -13,6 +13,7 @@ #include "gettext.h" #include "dive.h" +#include "divelist.h" #include "device.h" #include "membuffer.h" #include "git-access.h" @@ -745,13 +746,15 @@ static void parse_settings_userid(char *line, struct membuffer *str, void *_unus * Our versioning is a joke right now, but this is more of an example of what we * *can* do some day. And if we do change the version, this warning will show if * you read with a version of subsurface that doesn't know about it. + * We MUST keep this in sync with the XML version (so we can report a consistent + * minimum datafile version) */ -#define VERSION 3 static void parse_settings_version(char *line, struct membuffer *str, void *_unused) { int version = atoi(line); - if (version > VERSION) - report_error("Git save file version %d is newer than version %d I know about", version, VERSION); + report_datafile_version(version); + if (version > DATAFORMAT_VERSION) + report_error("Git save file version %d is newer than version %d I know about", version, DATAFORMAT_VERSION); } /* The string in the membuffer is the version string of subsurface that saved things, just FYI */ |