[Cmake-commits] CMake branch, next, updated. v2.8.2-840-g3f981c4

Marcel Loose loose at astron.nl
Mon Sep 20 04:36:33 EDT 2010


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  3f981c48db9ba772412339ac80e14beb6efdb275 (commit)
       via  83c31ae00af38d2c8b3396c7e13caa66489c2bd1 (commit)
       via  b03087798b5fb769c2924942bae5c42911b0d11d (commit)
       via  d10b94b2f0c73c4766bb7c9047ddd78c8e470ffa (commit)
      from  25111637c9b67a6f8349413ad89aaf7aa833abfd (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=3f981c48db9ba772412339ac80e14beb6efdb275
commit 3f981c48db9ba772412339ac80e14beb6efdb275
Merge: 2511163 83c31ae
Author:     Marcel Loose <loose at astron.nl>
AuthorDate: Mon Sep 20 10:35:30 2010 +0200
Commit:     Marcel Loose <loose at astron.nl>
CommitDate: Mon Sep 20 10:35:30 2010 +0200

    Merge branch 'issue_10201' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83c31ae00af38d2c8b3396c7e13caa66489c2bd1
commit 83c31ae00af38d2c8b3396c7e13caa66489c2bd1
Author:     Marcel Loose <loose at astron.nl>
AuthorDate: Mon Sep 20 10:33:11 2010 +0200
Commit:     Marcel Loose <loose at astron.nl>
CommitDate: Mon Sep 20 10:33:11 2010 +0200

    Added macro Subversion_WC_UPDATE([path...]).
    
    This macro can be used to run 'svn update' on a working copy. If intermediate
    directories are missing, they will automatically be updated non-recursively.

diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index daf3d87..f218827 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -8,9 +8,11 @@
 # The minimum required version of Subversion can be specified using the
 # standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
 #
-# If the command line client executable is found two macros are defined:
+# If the command line client executable is found the following macros are
+# defined:
 #  Subversion_WC_INFO(<dir> <var-prefix>)
 #  Subversion_WC_LOG(<dir> <var-prefix>)
+#  Subversion_WC_UPDATE([path...])
 # Subversion_WC_INFO extracts information of a subversion working copy at
 # a given location. This macro defines the following variables:
 #  <var-prefix>_WC_URL - url of the repository (at <dir>)
@@ -24,6 +26,12 @@
 # subversion working copy at a given location. This macro defines the
 # variable:
 #  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+# Subversion_WC_UPDATE runs 'svn update' on each of the paths supplied as
+# argument. Each path will be converted to an absolute. This is necessary in
+# order to determine its position relative to the top-level source directory
+# CMAKE_SOURCE_DIR.  If any intermediate directories are missing, they will be
+# 'svn update'-d non-recursively as well.
+#
 # Example usage:
 #  FIND_PACKAGE(Subversion)
 #  IF(SUBVERSION_FOUND)
@@ -31,6 +39,10 @@
 #    MESSAGE("Current revision is ${Project_WC_REVISION}")
 #    Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
 #    MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
+#    Subversion_WC_UPDATE(${PROJECT_SOURCE_DIR})
+#    MESSAGE("Updated my working copy")
+#    Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+#    MESSAGE("Revision after update is ${Project_WC_REVISION}")
 #  ENDIF(SUBVERSION_FOUND)
 
 #=============================================================================
@@ -113,6 +125,34 @@ IF(Subversion_SVN_EXECUTABLE)
     ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0)
   ENDMACRO(Subversion_WC_LOG)
 
+  MACRO(Subversion_WC_UPDATE)
+    # This macro requires network access to the svn server and could be slow.
+    SET(_svn_update ${Subversion_SVN_EXECUTABLE} --non-interactive update -q)
+    FOREACH(_path ${ARGV})
+      IF(NOT IS_ABSOLUTE ${_path})
+        GET_FILENAME_COMPONENT(_path ${_path} ABSOLUTE)
+      ENDIF(NOT IS_ABSOLUTE ${_path})
+      STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" _dirs "${_path}")
+      STRING(REPLACE "/" ";" _dirs "${_dirs}")
+      SET(_wc ${CMAKE_SOURCE_DIR})
+      FOREACH(_dir ${_dirs})
+        SET(_wc ${_wc}/${_dir})
+        IF("${_wc}" STREQUAL "${_path}")
+          SET(_cmd ${_svn_update} "${_wc}")
+        ELSE("${_wc}" STREQUAL "${_path}")
+          SET(_cmd ${_svn_update} -N "${_wc}")
+        ENDIF("${_wc}" STREQUAL "${_path}")
+        EXECUTE_PROCESS(
+          COMMAND ${_cmd}
+          RESULT_VARIABLE _result
+          ERROR_VARIABLE _error)
+        IF(_result)
+          MESSAGE(SEND_ERROR "${_cmd} failed:\n${_error}")
+        ENDIF(_result)
+      ENDFOREACH(_dir ${_dirs})
+    ENDFOREACH(_path ${ARGV})
+  ENDMACRO(Subversion_WC_UPDATE)
+
 ENDIF(Subversion_SVN_EXECUTABLE)
 
 INCLUDE(FindPackageHandleStandardArgs)

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

Summary of changes:
 Modules/FindSubversion.cmake      |   42 ++++++++++++++++++++++++++++++++++++-
 Source/kwsys/kwsysDateStamp.cmake |    2 +-
 2 files changed, 42 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list