From a8667fa65d7e83add8099b293e8f737c8468d00c Mon Sep 17 00:00:00 2001
From: Peter Peterson <petersonpf@ornl.gov>
Date: Thu, 15 Aug 2013 13:45:06 -0400
Subject: [PATCH] Re #7321. Unified mantid version and added extra git attr.

---
 Code/Mantid/Framework/Kernel/CMakeLists.txt                | 1 +
 .../Framework/Kernel/inc/MantidKernel/MantidVersion.h      | 1 +
 Code/Mantid/Framework/Kernel/src/ConfigService.cpp         | 6 +++---
 Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in      | 7 ++++++-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt
index 37a95ec5f64..2e17581e307 100644
--- a/Code/Mantid/Framework/Kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt
@@ -366,6 +366,7 @@ add_subdirectory ( test )
 # determine it from git and the file already exists. This makes sure the 
 # version number is correct when building off the source tarball
 
+include (PatchVersionNumber)
 if ( NOT NOT_GIT_REPO OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp )
   configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp.in
                    ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MantidVersion.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MantidVersion.h
index 654ee178262..533ef742b43 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MantidVersion.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MantidVersion.h
@@ -37,6 +37,7 @@ class MANTID_KERNEL_DLL MantidVersion
 public:
   static const char* version();     ///< The full version number
   static const char* revision();    ///< The abbreviated SHA-1 of the last commit
+  static const char* revisionFull();    ///< The full SHA-1 of the last commit
   static const char* releaseDate(); ///< The date of the last commit
 
 private:
diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
index 86e76cdf2a0..5dfc1fdc3c1 100644
--- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
+++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
@@ -54,7 +54,7 @@ namespace Mantid
  */
 std::string welcomeMessage()
 {
-    return "Welcome to Mantid " + std::string(Mantid::Kernel::MantidVersion::version()) + " - Manipulation and Analysis Toolkit for Instrument Data";
+    return "Welcome to Mantid version " + std::string(Mantid::Kernel::MantidVersion::version()) + " - Manipulation and Analysis Toolkit for Instrument Data";
 }
 
 namespace Kernel
@@ -264,8 +264,8 @@ ConfigServiceImpl::ConfigServiceImpl() :
   g_log.debug() << "ConfigService created." << std::endl;
   g_log.debug() << "Configured Mantid.properties directory of application as " << getPropertiesDir()
       << std::endl;
-  g_log.information() << "This is Mantid Version "
-                      << MantidVersion::version() << "-" << MantidVersion::revision() << std::endl;
+  g_log.information() << "This is Mantid version "
+                      << MantidVersion::version() << " revision " << MantidVersion::revision() << std::endl;
   g_log.information() << "Properties file(s) loaded: " << propertiesFilesList << std::endl;
 #ifndef MPI_BUILD  // There is no logging to file by default in MPI build
   g_log.information() << "Logging to: " << m_logFilePath << std::endl;
diff --git a/Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in b/Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in
index 2554784c819..932e96de192 100644
--- a/Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in
+++ b/Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in
@@ -12,7 +12,7 @@ const char* MantidVersion::version()
 {
   // The major and minor version numbers are specified in Build/CMake/VersionNumber.cmake
   // The patch number is the number of commits since the most recent tag of the repository
-  return "@VERSION_MAJOR@.@VERSION_MINOR@.@MtdVersion_WC_LAST_CHANGED_REV@";
+  return "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@";
 }
 
 const char* MantidVersion::revision()
@@ -20,6 +20,11 @@ const char* MantidVersion::revision()
   return "@MtdVersion_WC_LAST_CHANGED_SHA@";
 }
 
+const char* MantidVersion::revisionFull()
+{
+  return "@MtdVersion_WC_LAST_CHANGED_SHA_LONG@";
+}
+
 const char* MantidVersion::releaseDate()
 {
   return "@MtdVersion_WC_LAST_CHANGED_DATE@";
-- 
GitLab