summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-10-18 07:58:32 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-10-18 07:59:54 -0700
commit2f656a0430f31656ebf81b6ee0690bc6ad04268f (patch)
tree3559bd9779bbbdb9dad67d315e1ade4c5008e805
parent4a5e72289713324ce6ff6000276bd81681b18666 (diff)
downloadcrawl-ref-2f656a0430f31656ebf81b6ee0690bc6ad04268f.tar.gz
crawl-ref-2f656a0430f31656ebf81b6ee0690bc6ad04268f.zip
versioning: remove SVN-specific revision data, add Git versioning
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
-rw-r--r--crawl-ref/source/abl-show.cc1
-rw-r--r--crawl-ref/source/abyss.cc1
-rw-r--r--crawl-ref/source/acr.cc1
-rw-r--r--crawl-ref/source/arena.cc4
-rw-r--r--crawl-ref/source/artefact.cc1
-rw-r--r--crawl-ref/source/beam.cc1
-rw-r--r--crawl-ref/source/branch.cc1
-rw-r--r--crawl-ref/source/chardump.cc6
-rw-r--r--crawl-ref/source/cio.cc1
-rw-r--r--crawl-ref/source/cloud.cc1
-rw-r--r--crawl-ref/source/clua.cc1
-rw-r--r--crawl-ref/source/command.cc7
-rw-r--r--crawl-ref/source/crash-d.cc1
-rw-r--r--crawl-ref/source/crash-u.cc1
-rw-r--r--crawl-ref/source/crash-w.cc1
-rw-r--r--crawl-ref/source/database.cc1
-rw-r--r--crawl-ref/source/debug.cc8
-rw-r--r--crawl-ref/source/decks.cc1
-rw-r--r--crawl-ref/source/delay.cc1
-rw-r--r--crawl-ref/source/describe.cc1
-rw-r--r--crawl-ref/source/dgnevent.cc1
-rw-r--r--crawl-ref/source/directn.cc1
-rw-r--r--crawl-ref/source/dungeon.cc1
-rw-r--r--crawl-ref/source/effects.cc1
-rw-r--r--crawl-ref/source/fight.cc1
-rw-r--r--crawl-ref/source/files.cc1
-rw-r--r--crawl-ref/source/food.cc1
-rw-r--r--crawl-ref/source/format.cc1
-rw-r--r--crawl-ref/source/ghost.cc1
-rw-r--r--crawl-ref/source/hiscores.cc5
-rw-r--r--crawl-ref/source/initfile.cc1
-rw-r--r--crawl-ref/source/invent.cc1
-rw-r--r--crawl-ref/source/it_use2.cc1
-rw-r--r--crawl-ref/source/it_use3.cc1
-rw-r--r--crawl-ref/source/item_use.cc1
-rw-r--r--crawl-ref/source/itemname.cc1
-rw-r--r--crawl-ref/source/itemprop.cc1
-rw-r--r--crawl-ref/source/items.cc1
-rw-r--r--crawl-ref/source/kills.cc1
-rw-r--r--crawl-ref/source/lev-pand.cc1
-rw-r--r--crawl-ref/source/libdos.cc1
-rw-r--r--crawl-ref/source/libgui.cc1
-rw-r--r--crawl-ref/source/libunix.cc1
-rw-r--r--crawl-ref/source/libutil.cc1
-rw-r--r--crawl-ref/source/libw32c.cc6
-rw-r--r--crawl-ref/source/los.cc1
-rw-r--r--crawl-ref/source/losparam.cc1
-rw-r--r--crawl-ref/source/luadgn.cc1
-rw-r--r--crawl-ref/source/macro.cc1
-rw-r--r--crawl-ref/source/makefile10
-rw-r--r--crawl-ref/source/makeitem.cc1
-rw-r--r--crawl-ref/source/mapdef.cc1
-rw-r--r--crawl-ref/source/mapmark.cc1
-rw-r--r--crawl-ref/source/maps.cc1
-rw-r--r--crawl-ref/source/menu.cc1
-rw-r--r--crawl-ref/source/message.cc1
-rw-r--r--crawl-ref/source/mgrow.cc1
-rw-r--r--crawl-ref/source/misc.cc1
-rw-r--r--crawl-ref/source/mon-pick.cc1
-rw-r--r--crawl-ref/source/mon-util.cc1
-rw-r--r--crawl-ref/source/monplace.cc1
-rw-r--r--crawl-ref/source/monspeak.cc1
-rw-r--r--crawl-ref/source/monstuff.cc1
-rw-r--r--crawl-ref/source/mstuff2.cc1
-rw-r--r--crawl-ref/source/mt19937ar.cc1
-rw-r--r--crawl-ref/source/mtransit.cc1
-rw-r--r--crawl-ref/source/mutation.cc1
-rw-r--r--crawl-ref/source/newgame.cc3
-rw-r--r--crawl-ref/source/notes.cc1
-rw-r--r--crawl-ref/source/ouch.cc1
-rw-r--r--crawl-ref/source/output.cc1
-rw-r--r--crawl-ref/source/overmap.cc1
-rw-r--r--crawl-ref/source/place.cc1
-rw-r--r--crawl-ref/source/player.cc1
-rw-r--r--crawl-ref/source/quiver.cc1
-rw-r--r--crawl-ref/source/ray.cc1
-rw-r--r--crawl-ref/source/religion.cc1
-rw-r--r--crawl-ref/source/sha256.cc1
-rw-r--r--crawl-ref/source/shopping.cc1
-rw-r--r--crawl-ref/source/skills.cc1
-rw-r--r--crawl-ref/source/skills2.cc1
-rw-r--r--crawl-ref/source/spells1.cc1
-rw-r--r--crawl-ref/source/spells2.cc1
-rw-r--r--crawl-ref/source/spells3.cc1
-rw-r--r--crawl-ref/source/spells4.cc1
-rw-r--r--crawl-ref/source/spl-book.cc1
-rw-r--r--crawl-ref/source/spl-cast.cc1
-rw-r--r--crawl-ref/source/spl-mis.cc1
-rw-r--r--crawl-ref/source/spl-util.cc1
-rw-r--r--crawl-ref/source/sqldbm.cc1
-rw-r--r--crawl-ref/source/stash.cc1
-rw-r--r--crawl-ref/source/state.cc1
-rw-r--r--crawl-ref/source/store.cc1
-rw-r--r--crawl-ref/source/stuff.cc1
-rw-r--r--crawl-ref/source/tags.cc19
-rw-r--r--crawl-ref/source/tags.h3
-rw-r--r--crawl-ref/source/terrain.cc1
-rw-r--r--crawl-ref/source/tile2.cc1
-rw-r--r--crawl-ref/source/tilebuf.cc1
-rw-r--r--crawl-ref/source/tilefont.cc1
-rw-r--r--crawl-ref/source/tilemcache.cc1
-rw-r--r--crawl-ref/source/tilepick.cc1
-rw-r--r--crawl-ref/source/tilereg.cc1
-rw-r--r--crawl-ref/source/tilesdl.cc4
-rw-r--r--crawl-ref/source/tiletex.cc1
-rw-r--r--crawl-ref/source/transfor.cc1
-rw-r--r--crawl-ref/source/traps.cc1
-rw-r--r--crawl-ref/source/travel.cc1
-rw-r--r--crawl-ref/source/tutorial.cc1
-rw-r--r--crawl-ref/source/version.cc56
-rw-r--r--crawl-ref/source/version.h121
-rw-r--r--crawl-ref/source/view.cc1
-rw-r--r--crawl-ref/source/xom.cc1
113 files changed, 149 insertions, 203 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 3cfe2dcdf8..7490f9b65d 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "abl-show.h"
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index 5d93e77e67..7adb8bed93 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "abyss.h"
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 0b782be733..1dea38d6ad 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <string>
#include <algorithm>
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index 6750cca200..f3ff332ab9 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
#include "arena.h"
@@ -424,8 +423,7 @@ namespace arena
cgotoxy(1, line++, GOTO_STAT);
textcolor(WHITE);
- center_print(crawl_view.hudsz.x,
- "Crawl " VER_NUM VER_QUAL " " VERSION_DETAIL);
+ center_print(crawl_view.hudsz.x, "Crawl " + Version::Long());
line++;
cgotoxy(1, line++, GOTO_STAT);
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index 4ca42dc402..96b03437da 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "artefact.h"
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 59b839ccf3..d2cb9b3db8 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "beam.h"
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc
index 84fcd8b2c9..3c632e5ea9 100644
--- a/crawl-ref/source/branch.cc
+++ b/crawl-ref/source/branch.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "branch.h"
#include "externs.h"
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 4931e15f22..99bfe4cd94 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "chardump.h"
#include "clua.h"
@@ -179,10 +178,7 @@ bool dump_char(const std::string &fname, bool show_prices, bool full_id,
static void _sdump_header(dump_params &par)
{
- par.text += " " CRAWL " version " VERSION;
-#ifdef DISPLAY_BUILD_REVISION
- par.text += " r" + number_to_string(svn_revision());
-#endif
+ par.text += " " CRAWL " version " + Version::Long();
par.text += " character file.\n\n";
}
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 7299d405a7..9a455a77ac 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "cio.h"
#include "externs.h"
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index f0d3146cf9..f9f60541ff 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -7,7 +7,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 19a15fd63a..9743019e9d 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
#include <sstream>
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 5f6098e577..674b1868da 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "command.h"
@@ -94,11 +93,7 @@ static const char *features[] = {
static std::string _get_version_information(void)
{
- std::string result = "This is <w>" CRAWL " " VERSION "</w> (";
-#ifdef DISPLAY_BUILD_REVISION
- result += "r" + number_to_string(svn_revision()) + ", ";
-#endif
- result += VERSION_DETAIL ").";
+ std::string result = "This is <w>" CRAWL " " + Version::Long() + "</w>";
result += "\n";
diff --git a/crawl-ref/source/crash-d.cc b/crawl-ref/source/crash-d.cc
index 12be2ebb63..642ddc1e04 100644
--- a/crawl-ref/source/crash-d.cc
+++ b/crawl-ref/source/crash-d.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "crash.h"
diff --git a/crawl-ref/source/crash-u.cc b/crawl-ref/source/crash-u.cc
index 052a2ea3ef..be7d63baea 100644
--- a/crawl-ref/source/crash-u.cc
+++ b/crawl-ref/source/crash-u.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_UNIX_SIGNALS
#include <signal.h>
diff --git a/crawl-ref/source/crash-w.cc b/crawl-ref/source/crash-w.cc
index 132373ade8..14c1e5c4aa 100644
--- a/crawl-ref/source/crash-w.cc
+++ b/crawl-ref/source/crash-w.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "crash.h"
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc
index 7584109827..4d20bd5295 100644
--- a/crawl-ref/source/database.cc
+++ b/crawl-ref/source/database.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index b4d7ab2281..fa916714d9 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "debug.h"
@@ -4345,7 +4344,7 @@ static void _fsim_mon_stats(FILE *o, const monsters &mon)
static void _fsim_title(FILE *o, int mon, int ms)
{
- fprintf(o, CRAWL " version " VERSION "\n\n");
+ fprintf(o, CRAWL " version %s\n\n", Version::Long());
fprintf(o, "Combat simulation: %s %s vs. %s (%ld rounds) (%s)\n",
species_name(you.species, you.experience_level).c_str(),
you.class_name,
@@ -4371,7 +4370,7 @@ static void _fsim_title(FILE *o, int mon, int ms)
static void _fsim_defence_title(FILE *o, int mon)
{
- fprintf(o, CRAWL " version " VERSION "\n\n");
+ fprintf(o, CRAWL " version %s\n\n", Version::Long());
fprintf(o, "Combat simulation: %s vs. %s %s (%ld rounds) (%s)\n",
menv[mon].name(DESC_PLAIN).c_str(),
species_name(you.species, you.experience_level).c_str(),
@@ -6505,8 +6504,7 @@ void do_crash_dump()
fprintf(file, "%s" EOL EOL, _assert_msg.c_str());
#endif
- fprintf(file, "Revision: %d" EOL, svn_revision());
- fprintf(file, "Version: %s" EOL, CRAWL " " VERSION);
+ fprintf(file, "Version: %s %s" EOL, CRAWL, Version::Long().c_str() );
#if defined(UNIX)
fprintf(file, "Platform: unix" EOL);
#endif
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index ad3e2c8a2c..d1f44439c8 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "decks.h"
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index e3fe61924c..ae2800430c 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 2cf3605aba..73e490690d 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "describe.h"
#include "database.h"
diff --git a/crawl-ref/source/dgnevent.cc b/crawl-ref/source/dgnevent.cc
index 2a5051d8ab..543d50e6f5 100644
--- a/crawl-ref/source/dgnevent.cc
+++ b/crawl-ref/source/dgnevent.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "dgnevent.h"
#include "stuff.h"
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 7adf1fbf4a..596fa92fb3 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "directn.h"
#include "format.h"
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 5893121c55..0f70733569 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <stdlib.h>
#include <stdio.h>
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 0c96386338..7542387230 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "effects.h"
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index a136971334..df0c080620 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "fight.h"
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index d8778ee39b..c26a07e38d 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "delay.h"
#include "files.h"
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 1de1eda272..21895531b8 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "food.h"
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc
index e45c3eb0f3..14571b6f55 100644
--- a/crawl-ref/source/format.cc
+++ b/crawl-ref/source/format.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "initfile.h"
#include "format.h"
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index fffe1dc4eb..c3fd89bbeb 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -7,7 +7,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "ghost.h"
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 5103d9a9e3..e7b62dcd8b 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -32,7 +32,6 @@
#endif
#include "AppHdr.h"
-REVISION("$Rev$");
#include "branch.h"
#include "files.h"
@@ -633,7 +632,7 @@ void scorefile_entry::set_base_xlog_fields() const
if (!fields.get())
fields.reset(new xlog_fields);
- fields->add_field("v", "%s", version.empty()? VER_NUM : version.c_str());
+ fields->add_field("v", "%s", Version::Short().c_str());
fields->add_field("lv", SCORE_VERSION);
fields->add_field("name", "%s", name.c_str());
fields->add_field("uid", "%d", uid);
@@ -940,7 +939,7 @@ void scorefile_entry::init()
// 4.1 - added real_time and num_turn fields
// 4.2 - stats and god info
- version = VER_NUM;
+ version = Version::Short();
name = you.your_name;
#ifdef MULTIUSER
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 7ad2e809a6..162b97fd2f 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "initfile.h"
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 7d5df507e4..2bbd8c9b70 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "invent.h"
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index fd65cb0db2..b4a6fd84aa 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "it_use2.h"
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index cdaedb3ad2..a18b5627f6 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "it_use3.h"
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 94795dba5d..5f271f4650 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "item_use.h"
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 982b98c137..caf5b0bef2 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "itemname.h"
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 1094b2dd83..6fa64ae27b 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "itemname.h"
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index c784cf2503..975a4da142 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "items.h"
#include "cio.h"
diff --git a/crawl-ref/source/kills.cc b/crawl-ref/source/kills.cc
index 6b7aef270d..ffc8b99473 100644
--- a/crawl-ref/source/kills.cc
+++ b/crawl-ref/source/kills.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/lev-pand.cc b/crawl-ref/source/lev-pand.cc
index 0498a9f2fb..fe4c4fddd4 100644
--- a/crawl-ref/source/lev-pand.cc
+++ b/crawl-ref/source/lev-pand.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/libdos.cc b/crawl-ref/source/libdos.cc
index b14137241a..d704f6eedb 100644
--- a/crawl-ref/source/libdos.cc
+++ b/crawl-ref/source/libdos.cc
@@ -9,7 +9,6 @@
// Every .cc must include AppHdr or bad things happen.
#include "AppHdr.h"
-REVISION("$Rev$");
#include "cio.h"
#include <termios.h>
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index d484929520..185428e109 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc
index 03c1631b9a..96046f6900 100644
--- a/crawl-ref/source/libunix.cc
+++ b/crawl-ref/source/libunix.cc
@@ -15,7 +15,6 @@
Jan 1998 Svante Gerhard <svante@algonet.se> */
#include "AppHdr.h"
-REVISION("$Rev$");
#include <stdio.h>
#include <stdlib.h>
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index b1bae48d62..7be6d37930 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "defines.h"
#include "directn.h"
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index 9fce53e0e1..74714a891e 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -1,5 +1,4 @@
#include "AppHdr.h"
-REVISION("$Rev$");
#if defined(WIN32CONSOLE)
@@ -90,7 +89,6 @@ static CHAR_INFO *screen = NULL;
static COORD screensize;
#define SCREENINDEX(x,y) ((x)+screensize.X*(y))
static bool buffering = false;
-// static const char *windowTitle = "Crawl " VERSION;
static unsigned InputCP, OutputCP;
static const unsigned PREFERRED_CODEPAGE = 437;
@@ -361,8 +359,10 @@ void init_libw32c(void)
exit(0);
}
+ std::string title = CRAWL " " + Version::Long();
+
GetConsoleTitle( oldTitle, 78 );
- SetConsoleTitle( CRAWL " " VERSION );
+ SetConsoleTitle( title.c_str() );
// Use the initial Windows setting for cursor size if it exists.
// TODO: Respect changing cursor size manually while Crawl is running.
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index 798e2fda1c..235eed5943 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -41,7 +41,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "los.h"
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index da30165ed1..9e523b4563 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "losparam.h"
diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc
index 098c4ee603..226138780f 100644
--- a/crawl-ref/source/luadgn.cc
+++ b/crawl-ref/source/luadgn.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <sstream>
#include <algorithm>
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc
index eeb5442f58..d52814bd80 100644
--- a/crawl-ref/source/macro.cc
+++ b/crawl-ref/source/macro.cc
@@ -21,7 +21,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#define MACRO_CC
#include "macro.h"
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile
index 449980eb20..e9d5421bc0 100644
--- a/crawl-ref/source/makefile
+++ b/crawl-ref/source/makefile
@@ -495,6 +495,7 @@ ifndef V
QUIET_CXX = @echo ' ' CXX $@;
QUIET_PCH = @echo ' ' PCH $@;
QUIET_LINK = @echo ' ' LINK $@;
+ QUIET_GEN = @echo ' ' GEN $@;
QUIET_COPY = @echo ' ' COPY $@;
QUIET_DEPEND = @echo ' ' DEPEND $@;
export V
@@ -544,7 +545,7 @@ LIB += $(LIBLUA) $(LIBSQLITE)
GAME_DEPENDS := $(DESTTILEFILES) $(OBJECTS) $(EXTRA_OBJECTS) $(CONTRIB_DEPENDS)
SRC_PKG_BASE := stone_soup
-SRC_VERSION := $(shell egrep 'VER_NUM *".*"' version.h | cut -d'"' -f2)
+SRC_VERSION := $(shell git describe --tags --long)
PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION)-src
SRC_PKG_TAR := $(PKG_SRC_DIR).tbz2
SRC_PKG_ZIP := $(PKG_SRC_DIR).zip
@@ -590,6 +591,13 @@ ifneq ($(MAKECMDGOALS),distclean)
endif
endif
+.INTERMEDIATE: build.h
+
+build.h:
+ $(QUIET_GEN)util/gen_ver.pl $@
+
+version.cc: build.h
+
##########################################################################
# The level compiler
#
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index a3b7329c91..fde59d13d5 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index face8ab8d7..20c5ceaf3e 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <iostream>
#include <cstdarg>
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc
index 22376bc2be..33599f1d28 100644
--- a/crawl-ref/source/mapmark.cc
+++ b/crawl-ref/source/mapmark.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 38960f8bb9..02b2456c51 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "maps.h"
#include "tags.h"
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index c89516add2..6877f349d5 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <cctype>
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc
index 8f898d8571..f32f91903b 100644
--- a/crawl-ref/source/message.cc
+++ b/crawl-ref/source/message.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "message.h"
#include "format.h"
diff --git a/crawl-ref/source/mgrow.cc b/crawl-ref/source/mgrow.cc
index 2d0d701089..777aba38b9 100644
--- a/crawl-ref/source/mgrow.cc
+++ b/crawl-ref/source/mgrow.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "enum.h"
#include "mgrow.h"
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index a43ce79974..932d1c1dc9 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "misc.h"
#include "notes.h"
diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc
index 394dfe4c3a..4861ef5011 100644
--- a/crawl-ref/source/mon-pick.cc
+++ b/crawl-ref/source/mon-pick.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "mon-pick.h"
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index a4ff66ed08..718906d008 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -8,7 +8,6 @@
// some routines snatched from former monsstat.cc
#include "AppHdr.h"
-REVISION("$Rev$");
#include "enum.h"
#include "mon-util.h"
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 8479914609..ac2e0e0ff5 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc
index 51857107ef..8d11f4619e 100644
--- a/crawl-ref/source/monspeak.cc
+++ b/crawl-ref/source/monspeak.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "monspeak.h"
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index d7bc0ab484..80bf089096 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "monstuff.h"
#include <stdlib.h>
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 4eb724ebde..36cb559ec1 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "mstuff2.h"
diff --git a/crawl-ref/source/mt19937ar.cc b/crawl-ref/source/mt19937ar.cc
index 85b6900ae8..543bd595c7 100644
--- a/crawl-ref/source/mt19937ar.cc
+++ b/crawl-ref/source/mt19937ar.cc
@@ -42,7 +42,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <stdio.h>
#include <string.h>
diff --git a/crawl-ref/source/mtransit.cc b/crawl-ref/source/mtransit.cc
index 9f06b61832..81a1bc1326 100644
--- a/crawl-ref/source/mtransit.cc
+++ b/crawl-ref/source/mtransit.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index e984c88972..e7b7d3b8fc 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "mutation.h"
#include <stdio.h>
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 193fe8edb8..c9cb283619 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "newgame.h"
@@ -3075,7 +3074,7 @@ static void _opening_screen(void)
#endif
std::string msg =
- "<yellow>Hello, welcome to " CRAWL " " VERSION "!</yellow>" EOL
+ "<yellow>Hello, welcome to " CRAWL " " + Version::Long() + "!</yellow>" EOL
"<brown>(c) Copyright 1997-2002 Linley Henzell, "
"2002-2009 Crawl DevTeam" EOL
"Please consult crawl_manual.txt for instructions and legal details."
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc
index 748da46ac2..6de85e0ff4 100644
--- a/crawl-ref/source/notes.cc
+++ b/crawl-ref/source/notes.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <vector>
#include <sstream>
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 2c4ec2a69f..02337d8dc0 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <string.h>
#include <string>
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 6779e355c7..718547729e 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "output.h"
diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc
index a56a2bcc73..7a848d1817 100644
--- a/crawl-ref/source/overmap.cc
+++ b/crawl-ref/source/overmap.cc
@@ -8,7 +8,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "overmap.h"
diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc
index fe589bc86c..0e64253394 100644
--- a/crawl-ref/source/place.cc
+++ b/crawl-ref/source/place.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
#include "place.h"
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 8f3343270a..d4eb9ea2f5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "player.h"
diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc
index a73f885416..6c14b7c5bc 100644
--- a/crawl-ref/source/quiver.cc
+++ b/crawl-ref/source/quiver.cc
@@ -8,7 +8,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "quiver.h"
diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc
index 4d08b9f579..fc88b57712 100644
--- a/crawl-ref/source/ray.cc
+++ b/crawl-ref/source/ray.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "ray.h"
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 954dd3cf03..baec478e9c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "religion.h"
diff --git a/crawl-ref/source/sha256.cc b/crawl-ref/source/sha256.cc
index 1f54dc2168..a36d316d92 100644
--- a/crawl-ref/source/sha256.cc
+++ b/crawl-ref/source/sha256.cc
@@ -7,7 +7,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev:$");
#include <stdint.h>
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index fa0699db33..f1bdf52653 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "shopping.h"
#include "message.h"
diff --git a/crawl-ref/source/skills.cc b/crawl-ref/source/skills.cc
index f353e0dff4..aef49cb535 100644
--- a/crawl-ref/source/skills.cc
+++ b/crawl-ref/source/skills.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "skills.h"
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 901b21a7fe..6b34fc6e76 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "skills2.h"
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index e49807379a..963cba6d11 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spells1.h"
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 8d8ac9ba7a..fc06542b6a 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spells2.h"
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 11b71d67e6..cc86af4712 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spells3.h"
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 075b0acf1b..ad6cdb8a78 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <string>
#include <iostream>
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index ecacd268b4..3a38121ff0 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spl-book.h"
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 29e6e1fdc9..cba831422c 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <sstream>
#include <iomanip>
diff --git a/crawl-ref/source/spl-mis.cc b/crawl-ref/source/spl-mis.cc
index e2cee8e971..20465845be 100644
--- a/crawl-ref/source/spl-mis.cc
+++ b/crawl-ref/source/spl-mis.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spl-mis.h"
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 56cb1eedb7..cabbeb0519 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "spl-util.h"
diff --git a/crawl-ref/source/sqldbm.cc b/crawl-ref/source/sqldbm.cc
index f523cc59ee..4337d5654b 100644
--- a/crawl-ref/source/sqldbm.cc
+++ b/crawl-ref/source/sqldbm.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "sqldbm.h"
#include "stuff.h"
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index c74e144a98..e62ddad8b6 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "artefact.h"
#include "chardump.h"
diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc
index 330f436610..aeb3739d1d 100644
--- a/crawl-ref/source/state.cc
+++ b/crawl-ref/source/state.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc
index 39afd8927c..cb0b539b30 100644
--- a/crawl-ref/source/store.cc
+++ b/crawl-ref/source/store.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "store.h"
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index efedacd0ea..afb69d56aa 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "beam.h"
#include "cio.h"
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index da5980878b..ac283fc6b5 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -58,7 +58,6 @@
#endif
#include "AppHdr.h"
-REVISION("$Rev$");
#include "artefact.h"
#include "branch.h"
@@ -1017,15 +1016,12 @@ static void tag_construct_you(writer &th)
if (!dlua.callfn("dgn_save_data", "u", &th))
mprf(MSGCH_ERROR, "Failed to save Lua data: %s", dlua.error.c_str());
- // minorVersion TAG_MINOR_SVNREV starts here
+ // minorVersion TAG_MINOR_GITREV starts here
// Write a human-readable string out on the off chance that
// we fail to be able to read this file back in using some later version.
- std::string revision = "SVN:";
- revision += number_to_string(svn_revision());
- revision += ":";
- revision += VERSION_DETAIL;
+ std::string revision = "Git:";
+ revision += Version::Long();
marshallString(th, revision);
- marshallLong(th, svn_revision());
}
static void tag_construct_you_items(writer &th)
@@ -1460,7 +1456,8 @@ static void tag_read_you(reader &th, char minorVersion)
dlua.error.c_str());
}
- if (minorVersion >= TAG_MINOR_SVNREV)
+ if (minorVersion >= TAG_MINOR_SVNREV &&
+ minorVersion < TAG_MINOR_GITREV)
{
std::string rev_str = unmarshallString(th);
int rev_int = unmarshallLong(th);
@@ -1468,6 +1465,12 @@ static void tag_read_you(reader &th, char minorVersion)
UNUSED(rev_str);
UNUSED(rev_int);
}
+
+ if (minorVersion >= TAG_MINOR_GITREV)
+ {
+ std::string rev_str = unmarshallString(th);
+ UNUSED(rev_str);
+ }
}
static void tag_read_you_items(reader &th, char minorVersion)
diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h
index f303cf5b69..dc0bae621d 100644
--- a/crawl-ref/source/tags.h
+++ b/crawl-ref/source/tags.h
@@ -71,7 +71,8 @@ enum tag_minor_version
TAG_MINOR_UGLY = 21, // More ghost bits for (very) ugly things.
TAG_MINOR_ROTTING = 22, // Added monster-specific rotting resistance.
TAG_MINOR_TRANS = 23, // Keep track of cancellable transformations.
- TAG_MINOR_VERSION = 23 // Current version. (Keep equal to max.)
+ TAG_MINOR_GITREV = 24, // Removed SVN revision and added Git revision.
+ TAG_MINOR_VERSION = 24 // Current version. (Keep equal to max.)
};
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 3dba3481ec..4fbadb45e2 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
#include "terrain.h"
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index 2b76eb6500..0534963612 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
#include <stdio.h>
diff --git a/crawl-ref/source/tilebuf.cc b/crawl-ref/source/tilebuf.cc
index f27671a517..1c9cbf2763 100644
--- a/crawl-ref/source/tilebuf.cc
+++ b/crawl-ref/source/tilebuf.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/tilefont.cc b/crawl-ref/source/tilefont.cc
index 6c2c9e2d5a..517279f803 100644
--- a/crawl-ref/source/tilefont.cc
+++ b/crawl-ref/source/tilefont.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/tilemcache.cc b/crawl-ref/source/tilemcache.cc
index 9e1c403456..9ee4023dff 100644
--- a/crawl-ref/source/tilemcache.cc
+++ b/crawl-ref/source/tilemcache.cc
@@ -1,5 +1,4 @@
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 7fffae2f1d..7ec14873d9 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -4,7 +4,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
#include <stdio.h>
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index d84a6bd320..bafef8028a 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -6,7 +6,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 074fb9d4b3..9ff0166578 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1,5 +1,4 @@
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
@@ -249,7 +248,8 @@ bool TilesFramework::initialise()
SDL_EnableUNICODE(true);
- SDL_WM_SetCaption(CRAWL " " VERSION, CRAWL);
+ std::string title = CRAWL " " + Version::Long();
+ SDL_WM_SetCaption(title.c_str(), CRAWL);
const char *icon_name =
#ifdef DATA_DIR_PATH
DATA_DIR_PATH
diff --git a/crawl-ref/source/tiletex.cc b/crawl-ref/source/tiletex.cc
index 83c76c50b2..ec65f779a1 100644
--- a/crawl-ref/source/tiletex.cc
+++ b/crawl-ref/source/tiletex.cc
@@ -1,5 +1,4 @@
#include "AppHdr.h"
-REVISION("$Rev$");
#ifdef USE_TILE
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index 3330fe472b..5f5eb5b950 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "transfor.h"
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 2eee6d8855..c0b3f22f5b 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "externs.h"
#include "traps.h"
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index ec9b4ca028..ec219875cf 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -8,7 +8,6 @@
* refactor.
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "files.h"
#include "fixary.h"
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index 119405fbac..f3168058fd 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -7,7 +7,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "cio.h"
diff --git a/crawl-ref/source/version.cc b/crawl-ref/source/version.cc
index 2a23818b56..0805bb5c8e 100644
--- a/crawl-ref/source/version.cc
+++ b/crawl-ref/source/version.cc
@@ -1,27 +1,53 @@
/*
* File: version.cc
* Summary: Version (and revision) functionality.
- * Written by: Enne Walker
+ * Written by: Steven Noonan
*/
#include "AppHdr.h"
-REVISION("$Rev$");
-int check_revision::max_rev = 0;
+#include "build.h"
-check_revision::check_revision(const char *rev_str)
+namespace Version
{
- ASSERT(!strncmp("$Rev:", rev_str, 4));
+ std::string Short()
+ {
+ return std::string(CRAWL_VERSION_TAG);
+ }
- int rev = atoi(&rev_str[5]);
- max_rev = std::max(rev, max_rev);
-}
+ std::string Long()
+ {
+ return std::string(CRAWL_VERSION_LONG);
+ }
-int svn_revision()
-{
-#if BUILD_REVISION
- return BUILD_REVISION;
-#else
- return check_revision::max_rev;
-#endif
+ int Major()
+ {
+ return CRAWL_VERSION_MAJOR;
+ }
+
+ int Minor()
+ {
+ return CRAWL_VERSION_MINOR;
+ }
+
+ int Revision()
+ {
+ return CRAWL_VERSION_REVISION;
+ }
+
+ int Build()
+ {
+ return CRAWL_VERSION_BUILD;
+ }
+
+ Class ReleaseType()
+ {
+ return CRAWL_VERSION_PREREL_TYPE;
+ }
+
+ int ReleaseID()
+ {
+ return CRAWL_VERSION_PREREL_NUM;
+ }
}
+
diff --git a/crawl-ref/source/version.h b/crawl-ref/source/version.h
index 2a0e251113..8b8341b2a3 100644
--- a/crawl-ref/source/version.h
+++ b/crawl-ref/source/version.h
@@ -3,65 +3,88 @@
* Summary: Contains version information
*/
-/* Crawl versioning:
- * Crawl uses three numbers to determine the version:
- * Version, which changes when the dev team makes enormous overhauls
- * to the game (which may cause savefiles from previous versions to
- * temporarily stop working, for example)
- * Release, which changes when siginficant new features have been
- * added to the game.
- * Mod, which changes with every publicly released version that
- * contains nothing more than bug fixes, cosmetic changes,
- * internal cleanup, etc.
- *
- * Further, any source or binary uploaded anywhere that is _not_ of
- * release quality should be labelled as such:
- * alpha for potentially unstable dev versions, or
- * beta for feature-complete and mostly balanced versions
- *
- * several alphas or betas in a row should be labelled incrementally;
- * alpha1 -> alpha2 -> alpha3 -> beta1 -> beta2 -> ...
- */
-
-
#ifndef VERSION_H
#define VERSION_H
#define CRAWL "Dungeon Crawl Stone Soup"
-#define VER_NUM "0.6"
-#define VER_QUAL "-git"
+namespace Version
+{
+ //! The short version string.
+ /*!
+ * This version will generally match the last version tag. For instance,
+ * if the last tag of Crawl before this build was '0.1.2', you'd see
+ * '0.1.2'. This version number does not include some rather important
+ * extra information useful for getting the exact revision (the Git commit
+ * hash and the number of revisions since the tag). For that extra information,
+ * use Version::Long() instead.
+ *
+ * For extracting individual components of the version, you should use the
+ * Major(), Minor(), Revision() and Build() functions.
+ */
+ std::string Short();
-// Undefine for official releases.
-#define DISPLAY_BUILD_REVISION
+ //! The long version string.
+ /*!
+ * This string contains detailed version information about the CrissCross
+ * build in use. The string will always start with the Git tag that this
+ * build descended from. If this build is not an exact match for a given
+ * tag, this string will also include the number of commits since the tag
+ * and the Git commit id (the SHA-1 hash).
+ */
+ std::string Long();
-// last updated 07august2001 {mv}
-/* ***********************************************************************
- * called from: chardump - command - newgame
- * *********************************************************************** */
-#define VERSION VER_NUM VER_QUAL " (crawl-ref)"
+ //! The major version number.
+ /*!
+ * This is the first number to appear in a version tag. For instance,
+ * if the tag is '0.1.2.3', this function would return '0'.
+ */
+ int Major();
-// last updated 20feb2001 {GDL}
-/* ***********************************************************************
- * called from: command
- * *********************************************************************** */
-#define VERSION_DETAIL __DATE__
+ //! The minor version number.
+ /*!
+ * This is the second number to appear in a version tag. For instance,
+ * if the tag is '0.1.2.3', this function would return '1'.
+ */
+ int Minor();
-// Returns the largest SVN revision number that a source file has been updated
-// to. This is not perfectly accurate, but should be good enough for save
-// files, as breaking a save almost always involves changing a source file.
-int svn_revision();
+ //! The revision number.
+ /*!
+ * This is the third number to appear in a version tag. For instance,
+ * if the tag is '0.1.2.3', this function would return '2'.
+ */
+ int Revision();
-class check_revision
-{
-public:
- check_revision(const char *rev_string);
- static int max_rev;
-};
+ //! The build number.
+ /*!
+ * This is the fourth number to appear in a version tag. For instance,
+ * if the tag is '0.1.2.3', this function would return '3'.
+ */
+ int Build();
+
+ typedef enum {
+ DEV, /*!< In-development version (does not exactly match a tag). i.e. '0.1.2-3-g3af4131'. */
+ ALPHA, /*!< An alpha release. i.e. '0.1.2-a3' */
+ BETA, /*!< A beta release. i.e. '0.1.2-b3' */
+ RC, /*!< A release candidate. i.e. '0.1.2-rc3' */
+ FINAL /*!< A final release. i.e. '0.1.2' */
+ } Class;
+
+ //! The release class.
+ /*!
+ * Indicates the type of release. For instance, if you have a tag such
+ * as '0.1.2-b1', the class is 'BETA'. Valid suffixes are '-a', '-b',
+ * '-rc'. If the version string does not precisely match a tag, then it
+ * is considered an in-development version.
+ */
+ Class ReleaseType();
-// This macro is meant to be used once per source file.
-// It can't be put in header files, as there's no way to generate a unique
-// object name across includes. Blame the lack of cross-platform __COUNTER__.
-#define REVISION(rev) static check_revision check_this_source_file_revision(rev)
+ //! The release ID.
+ /*!
+ * If this is a special type of release (alpha, beta, rc), then this
+ * will return the alpha/beta/rc number. Otherwise, this returns 0.
+ */
+ int ReleaseID();
+}
#endif
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 23b6909e41..e032dab122 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include "view.h"
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 28bc00d85b..949c9deac1 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -5,7 +5,6 @@
*/
#include "AppHdr.h"
-REVISION("$Rev$");
#include <algorithm>