# HG changeset patch # User Santeri Piippo # Date 1403446652 -10800 # Node ID a7d5a97839a079e8bfafd6db7e39a904b5d607ce # Parent 2a8889692c25d40e32922d36b3f1759edd0764ad - adapted the code to use hg-based updaterevision diff -r 2a8889692c25 -r a7d5a97839a0 CMakeLists.txt --- a/CMakeLists.txt Sun Jun 22 14:51:41 2014 +0300 +++ b/CMakeLists.txt Sun Jun 22 17:17:32 2014 +0300 @@ -14,7 +14,7 @@ get_target_property (UPDATEREVISION_EXE updaterevision LOCATION) add_custom_target (revision_check ALL - COMMAND ${UPDATEREVISION_EXE} gitinfo.h + COMMAND ${UPDATEREVISION_EXE} ${CMAKE_SOURCE_DIR} hginfo.h WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS updaterevision) diff -r 2a8889692c25 -r a7d5a97839a0 src/mainWindow.cc --- a/src/mainWindow.cc Sun Jun 22 14:51:41 2014 +0300 +++ b/src/mainWindow.cc Sun Jun 22 17:17:32 2014 +0300 @@ -271,7 +271,7 @@ #endif // DEBUG if (commitTimeString()[0] != '\0') - title += format (" (%1)", commitTimeString()); + title += format (" (%1)", QString::fromUtf8 (commitTimeString())); setWindowTitle (title); } diff -r 2a8889692c25 -r a7d5a97839a0 src/version.cc --- a/src/version.cc Sun Jun 22 14:51:41 2014 +0300 +++ b/src/version.cc Sun Jun 22 17:17:32 2014 +0300 @@ -22,8 +22,9 @@ #include #include +#include #include "version.h" -#include "gitinfo.h" +#include "hginfo.h" char g_versionString[64] = {'\0'}; char g_fullVersionString[256] = {'\0'}; @@ -51,8 +52,8 @@ { if (g_fullVersionString[0] == '\0') { -#if BUILD_ID != BUILD_RELEASE - strcpy (g_fullVersionString, GIT_DESCRIPTION); +#if BUILD_ID != BUILD_RELEASE && defined (SVN_REVISION_STRING) + strcpy (g_fullVersionString, SVN_REVISION_STRING); #else sprintf (g_fullVersionString, "v%s", versionString()); #endif @@ -65,9 +66,12 @@ // const char* commitTimeString() { -#ifdef GIT_TIME +#ifdef SVN_REVISION_NUMBER if (g_buildTime[0] == '\0') - strcpy (g_buildTime, GIT_TIME); + { + time_t timestamp = SVN_REVISION_NUMBER; + strftime (g_buildTime, sizeof g_buildTime, "%d %b %Y %T", localtime (×tamp)); + } #endif return g_buildTime;