[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1720-g0e0ba3d

Brad King brad.king at kitware.com
Tue Feb 25 11:14:00 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  0e0ba3dee256ded29fd28f08f9b7ad726e3c70e6 (commit)
       via  bcefbe737dee16c58bc578d4d483727ff859f8de (commit)
       via  8993df6c3db7a105f146f07b7ff5585698b1c29c (commit)
      from  68cedaf0637cb9ec4714cea185bca72954409c89 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e0ba3dee256ded29fd28f08f9b7ad726e3c70e6
commit 0e0ba3dee256ded29fd28f08f9b7ad726e3c70e6
Merge: 68cedaf bcefbe7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 25 11:13:59 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 25 11:13:59 2014 -0500

    Merge topic 'FindHg-add-WC_INFO' into next
    
    bcefbe73 FindHg: Add Hg_WC_INFO macro
    8993df6c FindHg: Search for TortoiseHg


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcefbe737dee16c58bc578d4d483727ff859f8de
commit bcefbe737dee16c58bc578d4d483727ff859f8de
Author:     Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Sat Feb 22 19:46:48 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 25 11:14:06 2014 -0500

    FindHg: Add Hg_WC_INFO macro
    
    Add a macro to extract information from a Hg work tree much like the
    Subversion_WC_INFO macro does for Subversion work tree.

diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index 8dea652..c418afd 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -2,7 +2,7 @@
 # FindHg
 # ------
 #
-#
+# Extract information from a mercurial working copy.
 #
 # The module defines the following variables:
 #
@@ -12,6 +12,20 @@
 #    HG_FOUND - true if the command line client was found
 #    HG_VERSION_STRING - the version of mercurial found
 #
+# If the command line client executable is found the following macro is defined:
+#
+# ::
+#
+#   HG_WC_INFO(<dir> <var-prefix>)
+#
+# Hg_WC_INFO extracts information of a mercurial working copy
+# at a given location.  This macro defines the following variables:
+#
+# ::
+#
+#   <var-prefix>_WC_CHANGESET - current changeset
+#   <var-prefix>_WC_REVISION - current revision
+#
 # Example usage:
 #
 # ::
@@ -19,11 +33,15 @@
 #    find_package(Hg)
 #    if(HG_FOUND)
 #      message("hg found: ${HG_EXECUTABLE}")
+#      HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+#      message("Current revision is ${Project_WC_REVISION}")
+#      message("Current changeset is ${Project_WC_CHANGESET}")
 #    endif()
 
 #=============================================================================
 # Copyright 2010-2012 Kitware, Inc.
 # Copyright 2012      Rolf Eike Beer <eike at sf-mail.de>
+# Copyright 2014      Matthaeus G. Chajdas
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -53,6 +71,21 @@ if(HG_EXECUTABLE)
     set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
   endif()
   unset(hg_version)
+
+  macro(HG_WC_INFO dir prefix)
+    execute_process(COMMAND ${HG_EXECUTABLE} id -i -n
+      WORKING_DIRECTORY ${dir}
+      RESULT_VARIABLE hg_id_result
+      ERROR_VARIABLE hg_id_error
+      OUTPUT_VARIABLE ${prefix}_WC_DATA
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    if(NOT ${hg_id_result} EQUAL 0)
+      message(SEND_ERROR "Command \"${HG_EXECUTBALE} id -n\" in directory ${dir} failed with output:\n${hg_id_error}")
+    endif()
+
+    string(REGEX REPLACE "([0-9a-f]+)\\+? [0-9]+\\+?" "\\1" ${prefix}_WC_CHANGESET ${${prefix}_WC_DATA})
+    string(REGEX REPLACE "[0-9a-f]+\\+? ([0-9]+)\\+?" "\\1" ${prefix}_WC_REVISION ${${prefix}_WC_DATA})
+  endmacro(HG_WC_INFO)
 endif()
 
 # Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8993df6c3db7a105f146f07b7ff5585698b1c29c
commit 8993df6c3db7a105f146f07b7ff5585698b1c29c
Author:     Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Sat Feb 22 19:46:48 2014 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 25 11:13:49 2014 -0500

    FindHg: Search for TortoiseHg
    
    Use the TortoiseHg registry entry as a search path.

diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index a1fb33f..8dea652 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -37,6 +37,8 @@
 
 find_program(HG_EXECUTABLE
   NAMES hg
+  PATHS
+    [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
   PATH_SUFFIXES Mercurial
   DOC "hg command line client"
   )

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list