- adapted the code to use hg-based updaterevision

Sun, 22 Jun 2014 17:17:32 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sun, 22 Jun 2014 17:17:32 +0300
changeset 808
a7d5a97839a0
parent 807
2a8889692c25
child 809
2b83f47044fd

- adapted the code to use hg-based updaterevision

CMakeLists.txt file | annotate | diff | comparison | revisions
src/mainWindow.cc file | annotate | diff | comparison | revisions
src/version.cc file | annotate | diff | comparison | revisions
--- 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)
 
--- 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);
 }
--- 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 <stdio.h>
 #include <string.h>
+#include <time.h>
 #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 (&timestamp));
+	}
 #endif
 
 	return g_buildTime;

mercurial