diff options
author | Brad King <brad.king@kitware.com> | 2008-05-19 14:03:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-05-19 14:03:59 (GMT) |
commit | e0b26f4aea8357d9e90ac5609376ba3fd380c02b (patch) | |
tree | 2dce1d9a3c9543c5604351b2cf7e857d1111dd14 /Modules/FindSubversion.cmake | |
parent | 2783b537cd0d0a3344c7201e8a2a0010e69198f2 (diff) | |
download | CMake-e0b26f4aea8357d9e90ac5609376ba3fd380c02b.zip CMake-e0b26f4aea8357d9e90ac5609376ba3fd380c02b.tar.gz CMake-e0b26f4aea8357d9e90ac5609376ba3fd380c02b.tar.bz2 |
BUG: Fixes for FindSubversion
- Split log out from Subversion_WC_INFO into Subversion_WC_LOG
- Fix report of log info to be in <var-prefix>_WC_LAST_CHANGED_LOG
as documented (instead of Subversion_LAST_CHANGED_LOG)
- Fix setting of LC_ALL environment variable to be inside macro
- Patch from Tanguy Krotoff
- See issue #7047
Diffstat (limited to 'Modules/FindSubversion.cmake')
-rw-r--r-- | Modules/FindSubversion.cmake | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 32c66d3..00c4251 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -20,6 +20,8 @@ # IF(Subversion_FOUND) # Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project) # MESSAGE("Current revision is ${Project_WC_REVISION}") +# Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project) +# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}") # ENDIF(Subversion_FOUND) # Copyright (c) 2006, Tristan Carel @@ -52,11 +54,6 @@ SET(Subversion_FOUND FALSE) SET(Subversion_SVN_FOUND FALSE) -# the subversion commands should be executed with the C locale, otherwise -# the message (which are parsed) may be translated, Alex -SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}" ) -SET(ENV{LC_ALL} C) - FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn DOC "subversion command line client") MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) @@ -66,6 +63,11 @@ IF(Subversion_SVN_EXECUTABLE) SET(Subversion_FOUND TRUE) MACRO(Subversion_WC_INFO dir prefix) + # the subversion commands should be executed with the C locale, otherwise + # the message (which are parsed) may be translated, Alex + SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}") + SET(ENV{LC_ALL} C) + EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version WORKING_DIRECTORY ${dir} OUTPUT_VARIABLE Subversion_VERSION_SVN @@ -96,9 +98,19 @@ IF(Subversion_SVN_EXECUTABLE) ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0) + # restore the previous LC_ALL + SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) + + ENDMACRO(Subversion_WC_INFO) + + MACRO(Subversion_WC_LOG dir prefix) + # This macro can block if the certificate is not signed: + # svn ask you to accept the certificate and wait for your answer + # This macro requires a svn server network access (Internet most of the time) + # and can also be slow since it access the svn server EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} log -r BASE ${dir} - OUTPUT_VARIABLE Subversion_LAST_CHANGED_LOG + OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG ERROR_VARIABLE Subversion_svn_log_error RESULT_VARIABLE Subversion_svn_log_result OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -106,13 +118,10 @@ IF(Subversion_SVN_EXECUTABLE) IF(NOT ${Subversion_svn_log_result} EQUAL 0) MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}") ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0) - ENDMACRO(Subversion_WC_INFO) + ENDMACRO(Subversion_WC_LOG) ENDIF(Subversion_SVN_EXECUTABLE) -# restore the previous LC_ALL -SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) - IF(NOT Subversion_FOUND) IF(NOT Subversion_FIND_QUIETLY) MESSAGE(STATUS "Subversion was not found.") |