Core: get rid of the revision-id once and for all - it's not useful in a DVCS at all

This commit is contained in:
click
2011-04-28 18:53:23 +02:00
parent 2d752b974a
commit 6a431f745c
8 changed files with 14 additions and 69 deletions
+2 -6
View File
@@ -54,14 +54,10 @@ if(NOT rev_info)
# No valid ways available to find/set the revision/hash, so let's force some defaults # No valid ways available to find/set the revision/hash, so let's force some defaults
set(rev_hash_str "Archive") set(rev_hash_str "Archive")
set(rev_hash "0") set(rev_hash "0")
set(rev_id_str "0")
set(rev_id "0")
else() else()
# Extract revision and hash from git # Extract revision and hash from git
string(REGEX REPLACE init-|[0-9]+-g "" rev_hash_str ${rev_info}) string(REGEX REPLACE init-|[0-9]+-g "" rev_hash_str ${rev_info})
string(REGEX REPLACE [+]+ "" rev_hash ${rev_hash_str}) string(REGEX REPLACE [+]+ "" rev_hash ${rev_hash_str})
string(REGEX REPLACE init-|-g[^+]+ "" rev_id_str ${rev_info})
string(REGEX REPLACE [+]+ "" rev_id ${rev_id_str})
endif() endif()
# Its not set during initial run # Its not set during initial run
@@ -70,11 +66,11 @@ if(NOT BUILDDIR)
endif() endif()
# Create the actual revision.h file from the above params # Create the actual revision.h file from the above params
if(NOT "${rev_id_cached}" MATCHES "${rev_id_str}") if(NOT "${rev_hash_cached}" MATCHES "${rev_hash_str}")
configure_file( configure_file(
"${CMAKE_SOURCE_DIR}/revision.h.in.cmake" "${CMAKE_SOURCE_DIR}/revision.h.in.cmake"
"${BUILDDIR}/revision.h" "${BUILDDIR}/revision.h"
@ONLY @ONLY
) )
set(rev_id_cached "${rev_id_str}" CACHE INTERNAL "Cached revision ID") set(rev_hash_cached "${rev_hash_str}" CACHE INTERNAL "Cached commit-hash")
endif() endif()
+2 -2
View File
@@ -1,6 +1,6 @@
# output generic information about the core and buildtype chosen # output generic information about the core and buildtype chosen
message("")
message("* TrinityCore revision : ${rev_id_str} (${rev_hash_str})") message("* TrinityCore commithash : ${rev_hash_str}")
if( UNIX ) if( UNIX )
message("* Build binaries in : ${CMAKE_BUILD_TYPE} mode") message("* Build binaries in : ${CMAKE_BUILD_TYPE} mode")
endif() endif()
-29
View File
@@ -1,29 +0,0 @@
@echo off &setlocal EnableDelayedExpansion
set usage=Usage: %0 ^<-id ^| -hash^>
set errormsg=Error: No valid revision information found
set cmres=false
if "%1"=="-id" set cmres=true
if "%1"=="-hash" set cmres=true
if not "!cmres!"=="true" (
echo !usage!
exit /B 1
)
for /F "tokens=2,3 delims=-" %%a IN ('"git describe --match=init --abbrev=12"') do (
set res=false
if %%c=="" set res=true
if %%d=="" set res=true
if "!res!"=="true" (
echo !errormsg!
exit /B 1
)
if "%1"=="-id" (
echo %%a
) else if "%1"=="-hash" (
set str=%%b
set str=!str:~1!
echo !str!
)
)
-20
View File
@@ -1,20 +0,0 @@
#/bin/bash
command=$(git describe --match init --abbrev=12)
IFS="-"
cmdarray=($command)
if [ "$1" != "-id" ] && [ "$1" != "-hash" ]; then
echo "Usage: $0 <-id | -hash>"
exit
fi
if [ "${cmdarray[1]}" == "" ] || [ "${cmdarray[2]}" == "" ]; then
echo "Error: No valid revision information found"
exit 1
fi
if [ "$1" == "-id" ]; then
echo ${cmdarray[1]}
elif [ "$1" == "-hash" ]; then
echo ${cmdarray[2]:1}
fi
+4 -5
View File
@@ -1,9 +1,8 @@
#ifndef __REVISION_H__ #ifndef __REVISION_H__
#define __REVISION_H__ #define __REVISION_H__
#define _REVISION "@rev_id_str@"
#define _HASH "@rev_hash_str@" #define _HASH "@rev_hash_str@"
#define FILEVER 0,0,@rev_id@,0 #define FILEVER 0,0,0
#define PRODUCTVER 0,0,@rev_id@,0 #define PRODUCTVER 0,0,0
#define STRFILEVER "0, 0, @rev_id@, @rev_hash@" #define STRFILEVER "0, 0, @rev_hash_str@"
#define STRPRODUCTVER "0, 0, @rev_id@, @rev_hash@" #define STRPRODUCTVER "0, 0, @rev_hash_str@"
#endif // __REVISION_H__ #endif // __REVISION_H__
@@ -96,10 +96,10 @@ PEXCEPTION_POINTERS pExceptionInfo)
SYSTEMTIME systime; SYSTEMTIME systime;
GetLocalTime(&systime); GetLocalTime(&systime);
sprintf(m_szDumpFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].dmp", sprintf(m_szDumpFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].dmp",
crash_folder_path, _REVISION, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond); crash_folder_path, _HASH, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
sprintf(m_szLogFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].txt", sprintf(m_szLogFileName, "%s\\%s_%s_[%u-%u_%u-%u-%u].txt",
crash_folder_path, _REVISION, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond); crash_folder_path, _HASH, pos, systime.wDay, systime.wMonth, systime.wHour, systime.wMinute, systime.wSecond);
m_hDumpFile = CreateFile(m_szDumpFileName, m_hDumpFile = CreateFile(m_szDumpFileName,
GENERIC_WRITE, GENERIC_WRITE,
+3 -4
View File
@@ -34,12 +34,11 @@
#if PLATFORM == PLATFORM_WINDOWS #if PLATFORM == PLATFORM_WINDOWS
# ifdef _WIN64 # ifdef _WIN64
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win64, " _ENDIAN_STRING ")" # define _FULLVERSION _PACKAGENAME "Hash: " _HASH " (Win64, "_BUILD_DIRECTIVE " (" _ENDIAN_STRING "))"
# else # else
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win32, " _ENDIAN_STRING ")" # define _FULLVERSION _PACKAGENAME "Hash: " _HASH " (Win32, " _BUILD_DIRECTIVE " (" _ENDIAN_STRING "))"
# endif # endif
#else #else
# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Unix, " _ENDIAN_STRING ")" # define _FULLVERSION _PACKAGENAME "Hash: " _HASH " (Unix, " _BUILD_DIRECTIVE " (" _ENDIAN_STRING "))"
#endif #endif
#endif #endif
+1 -1
View File
@@ -456,7 +456,7 @@ bool Master::_StartDB()
clearOnlineAccounts(); clearOnlineAccounts();
///- Insert version info into DB ///- Insert version info into DB
WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _REVISION); WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH);
sWorld->LoadDBVersion(); sWorld->LoadDBVersion();