Replace svn with vcs.

master
cybersphinx 2011-03-06 19:23:33 +01:00
parent d2eb159216
commit a30a8d21ce
5 changed files with 51 additions and 53 deletions

View File

@ -814,8 +814,8 @@ bool WriteOutput(const string& outputFile, const RevisionInformation& rev_info)
"#define AUTOREVISION_H\n" "#define AUTOREVISION_H\n"
"\n" "\n"
"\n" "\n"
"#ifndef SVN_AUTOREVISION_STATIC\n" "#ifndef VCS_AUTOREVISION_STATIC\n"
"#define SVN_AUTOREVISION_STATIC\n" "#define VCS_AUTOREVISION_STATIC\n"
"#endif\n" "#endif\n"
"\n" "\n"
"\n"; "\n";
@ -825,32 +825,32 @@ bool WriteOutput(const string& outputFile, const RevisionInformation& rev_info)
if(do_wx) if(do_wx)
header << "#include <wx/string.h>\n"; header << "#include <wx/string.h>\n";
header << "\n#define SVN_REV " << rev_info.revisionCount header << "\n#define VCS_NUM " << rev_info.revisionCount
<< "\n#define SVN_REV_STR \"" << rev_info.revision << "\"" << "\n#define VCS_REV_STR \"" << rev_info.revision << "\""
<< "\n#define SVN_DATE \"" << rev_info.date << "\"" << "\n#define VCS_DATE \"" << rev_info.date << "\""
<< "\n#define SVN_URI \"" << rev_info.wc_uri << "\"" << "\n#define VCS_URI \"" << rev_info.wc_uri << "\""
<< "\n#define SVN_TAG \"" << rev_info.tag << "\"\n" << "\n#define VCS_TAG \"" << rev_info.tag << "\"\n"
<< "\n#define SVN_SHORT_HASH \"" << rev_info.revision.substr(0, 7) << "\"" << "\n#define VCS_SHORT_HASH \"" << rev_info.revision.substr(0, 7) << "\""
<< "\n#define SVN_SHORT_HASH_WITHOUT_QUOTES " << rev_info.revision.substr(0, 7) << "\n#define VCS_SHORT_HASH_WITHOUT_QUOTES " << rev_info.revision.substr(0, 7)
<< "\n"; << "\n";
header << "\n#define SVN_WC_MODIFIED " << rev_info.wc_modified << "\n\n"; header << "\n#define VCS_WC_MODIFIED " << rev_info.wc_modified << "\n\n";
// Open namespace // Open namespace
if(do_int || do_std || do_wx) if(do_int || do_std || do_wx)
header << "namespace autorevision\n{\n"; header << "namespace autorevision\n{\n";
if(do_int) if(do_int)
header << "\tSVN_AUTOREVISION_STATIC const unsigned int svn_revision = " << rev_info.revision << ";\n"; header << "\tVCS_AUTOREVISION_STATIC const unsigned int vcs_revision = " << rev_info.revision << ";\n";
if(do_std) if(do_std)
header << "\tSVN_AUTOREVISION_STATIC const std::string svn_revision_s(\"" << rev_info.revision << "\");\n" header << "\tVCS_AUTOREVISION_STATIC const std::string vcs_revision_s(\"" << rev_info.revision << "\");\n"
<< "\tSVN_AUTOREVISION_STATIC const std::string svn_date_s(\"" << rev_info.date << "\");\n" << "\tVCS_AUTOREVISION_STATIC const std::string vcs_date_s(\"" << rev_info.date << "\");\n"
<< "\tSVN_AUTOREVISION_STATIC const std::string svn_uri_s(\"" << rev_info.wc_uri << "\");\n"; << "\tVCS_AUTOREVISION_STATIC const std::string vcs_uri_s(\"" << rev_info.wc_uri << "\");\n";
if(do_cstr) if(do_cstr)
header << "\tSVN_AUTOREVISION_STATIC const char svn_revision_cstr[] = \"" << rev_info.revision << "\";\n" header << "\tVCS_AUTOREVISION_STATIC const char vcs_revision_cstr[] = \"" << rev_info.revision << "\";\n"
<< "\tSVN_AUTOREVISION_STATIC const char svn_date_cstr[] = \"" << rev_info.date << "\";\n" << "\tVCS_AUTOREVISION_STATIC const char vcs_date_cstr[] = \"" << rev_info.date << "\";\n"
<< "\tSVN_AUTOREVISION_STATIC const char svn_uri_cstr[] = \"" << rev_info.wc_uri << "\";\n"; << "\tVCS_AUTOREVISION_STATIC const char vcs_uri_cstr[] = \"" << rev_info.wc_uri << "\";\n";
if(do_wx) if(do_wx)
{ {
if(do_translate) if(do_translate)
@ -858,21 +858,21 @@ bool WriteOutput(const string& outputFile, const RevisionInformation& rev_info)
header << "(\"" << rev_info.low_revision << "\"));\n" header << "(\"" << rev_info.low_revision << "\"));\n"
<< "\tSVN_AUTOREVISION_STATIC const wxString svnRevision("; << "\tVCS_AUTOREVISION_STATIC const wxString svnRevision(";
if(do_translate) if(do_translate)
header << "wxT"; header << "wxT";
header << "(\"" << rev_info.revision << "\"));\n" header << "(\"" << rev_info.revision << "\"));\n"
<< "\tSVN_AUTOREVISION_STATIC const wxString svnDate("; << "\tVCS_AUTOREVISION_STATIC const wxString svnDate(";
if(do_translate) if(do_translate)
header << "wxT"; header << "wxT";
header << "(\"" << rev_info.date << "\"));\n" header << "(\"" << rev_info.date << "\"));\n"
<< "\tSVN_AUTOREVISION_STATIC const wxString svnUri("; << "\tVCS_AUTOREVISION_STATIC const wxString svnUri(";
if(do_translate) if(do_translate)
header << "wxT"; header << "wxT";

View File

@ -555,7 +555,7 @@ static void initialize_PhysicsFS(const char* argv_0)
* *
* Priority: * Priority:
* Lower loads first. Current: * Lower loads first. Current:
* -datadir > User's home dir > SVN data > AutoPackage > BaseDir > DEFAULT_DATADIR * -datadir > User's home dir > source tree data > AutoPackage > BaseDir > DEFAULT_DATADIR
* *
* Only -datadir and home dir are allways examined. Others only if data still not found. * Only -datadir and home dir are allways examined. Others only if data still not found.
* *
@ -598,7 +598,7 @@ static void scanDataDirs( void )
if( !PHYSFS_exists("gamedesc.lev") ) if( !PHYSFS_exists("gamedesc.lev") )
{ {
// Data in SVN dir // Data in source tree
sstrcpy(tmpstr, prefix); sstrcpy(tmpstr, prefix);
sstrcat(tmpstr, "/data/"); sstrcat(tmpstr, "/data/");
registerSearchPath( tmpstr, 3 ); registerSearchPath( tmpstr, 3 );

View File

@ -3034,7 +3034,7 @@ void startMultiplayerGame(void)
{ {
debug(LOG_NET, "limiter was NOT activated, setting defaults"); debug(LOG_NET, "limiter was NOT activated, setting defaults");
// NOTE: TRUNK <->svn/2.3 difference, we don't load limiter_tex! // NOTE: master <-> 2.3 difference, we don't load limiter_tex!
if (!resLoad("wrf/limiter_tex.wrf", 501)) if (!resLoad("wrf/limiter_tex.wrf", 501))
{ {
debug(LOG_INFO, "Unable to load limiter_tex. Defaults not set."); debug(LOG_INFO, "Unable to load limiter_tex. Defaults not set.");

View File

@ -25,14 +25,12 @@
#include "version.h" #include "version.h"
#include "stringdef.h" #include "stringdef.h"
#define SVN_AUTOREVISION_STATIC static #define VCS_AUTOREVISION_STATIC static
#include "src/autorevision.h" #include "src/autorevision.h"
#define SVN_FULL_REV_STR "r" SVN_SHORT_HASH
unsigned int version_getRevision() unsigned int version_getRevision()
{ {
return SVN_REV; return VCS_NUM;
} }
const char* version_getVersionString() const char* version_getVersionString()
@ -41,29 +39,29 @@ const char* version_getVersionString()
if (version_string == NULL) if (version_string == NULL)
{ {
if (strncmp(svn_uri_cstr, "tags/", strlen("tags/")) == 0) if (strncmp(vcs_uri_cstr, "tags/", strlen("tags/")) == 0)
{ {
version_string = svn_uri_cstr + strlen("tags/"); version_string = vcs_uri_cstr + strlen("tags/");
} }
else if (strcmp(svn_uri_cstr, "trunk") == 0) else if (strcmp(vcs_uri_cstr, "trunk") == 0)
{ {
version_string = "TRUNK " SVN_FULL_REV_STR; version_string = "TRUNK " VCS_SHORT_HASH;
} }
else if (strncmp(svn_uri_cstr, "branches/", strlen("branches/")) == 0) else if (strncmp(vcs_uri_cstr, "branches/", strlen("branches/")) == 0)
{ {
version_string = (SVN_URI " branch " SVN_FULL_REV_STR) + strlen("branches/"); version_string = (VCS_URI " branch " VCS_SHORT_HASH) + strlen("branches/");
} }
else if (strncmp(svn_uri_cstr, "refs/heads/", strlen("refs/heads/")) == 0) else if (strncmp(vcs_uri_cstr, "refs/heads/", strlen("refs/heads/")) == 0)
{ {
version_string = (SVN_URI " branch " SVN_FULL_REV_STR) + strlen("refs/heads/"); version_string = (VCS_URI " branch " VCS_SHORT_HASH) + strlen("refs/heads/");
} }
else if (SVN_REV != 0) else if (VCS_NUM != 0)
{ {
version_string = SVN_URI " " SVN_FULL_REV_STR; version_string = VCS_URI " " VCS_SHORT_HASH;
} }
else else
{ {
version_string = SVN_FULL_REV_STR; version_string = VCS_SHORT_HASH;
} }
} }
@ -72,7 +70,7 @@ const char* version_getVersionString()
bool version_modified() bool version_modified()
{ {
#if (SVN_WC_MODIFIED) #if (VCS_WC_MODIFIED)
return true; return true;
#else #else
return false; return false;
@ -89,28 +87,28 @@ const char* version_getBuildTime()
return __TIME__; return __TIME__;
} }
const char* version_getSvnDate() const char* version_getVcsDate()
{ {
#if (SVN_REV == 0) #if (VCS_NUM == 0)
return ""; return "";
#else #else
static char svn_date[sizeof(svn_date_cstr) - 9] = { '\0' }; static char vcs_date[sizeof(vcs_date_cstr) - 9] = { '\0' };
if (svn_date[0] == '\0') if (vcs_date[0] == '\0')
{ {
sstrcpy(svn_date, svn_date_cstr); sstrcpy(vcs_date, vcs_date_cstr);
} }
return svn_date; return vcs_date;
#endif #endif
} }
const char* version_getSvnTime() const char* version_getVcsTime()
{ {
#if (SVN_REV == 0) #if (VCS_NUM == 0)
return ""; return "";
#else #else
return SVN_DATE + sizeof(SVN_DATE) - 8 - 1; return VCS_DATE + sizeof(VCS_DATE) - 8 - 1;
#endif #endif
} }
@ -121,7 +119,7 @@ const char* version_getFormattedVersionString()
if (versionString[0] == '\0') if (versionString[0] == '\0')
{ {
// Compose the working copy state string // Compose the working copy state string
#if (SVN_WC_MODIFIED) #if (VCS_WC_MODIFIED)
const char* wc_state = _(" (modified locally)"); const char* wc_state = _(" (modified locally)");
#else #else
const char* wc_state = ""; const char* wc_state = "";
@ -136,7 +134,7 @@ const char* version_getFormattedVersionString()
const char* build_date = NULL; const char* build_date = NULL;
if (strncmp(svn_uri_cstr, "tags/", strlen("tags/")) != 0) if (strncmp(vcs_uri_cstr, "tags/", strlen("tags/")) != 0)
{ {
sasprintf((char**)&build_date, _(" - Built %s"), version_getBuildDate()); sasprintf((char**)&build_date, _(" - Built %s"), version_getBuildDate());
} }

View File

@ -71,13 +71,13 @@ extern const char* version_getBuildTime(void);
* \return the date when this revision was committed to the subversion * \return the date when this revision was committed to the subversion
* repository * repository
*/ */
extern const char* version_getSvnDate(void); extern const char* version_getVcsDate(void);
/** Retrieves the time at which the source of this build was committed. /** Retrieves the time at which the source of this build was committed.
* \return the time when this revision was committed to the subversion * \return the time when this revision was committed to the subversion
* repository * repository
*/ */
extern const char* version_getSvnTime(void); extern const char* version_getVcsTime(void);
/** Composes a nicely formatted version string. /** Composes a nicely formatted version string.
* *
@ -88,7 +88,7 @@ extern const char* version_getSvnTime(void);
* - "<working copy state>" represents the modification and switch state * - "<working copy state>" represents the modification and switch state
* of the working copy from which this build was made. * of the working copy from which this build was made.
* - "<DATE>" the date of building as returned by version_getBuildDate() or * - "<DATE>" the date of building as returned by version_getBuildDate() or
* version_getSvnDate(); the latter is only used when the working * version_getVcsDate(); the latter is only used when the working
* copy has no local modifications. * copy has no local modifications.
* - "<BUILD TYPE>" the type of build produced (i.e. DEBUG or not) * - "<BUILD TYPE>" the type of build produced (i.e. DEBUG or not)
*/ */