[PATCH] D16299: [cmake] Fix add_version_info_from_vcs git svn version bug.
Geoff Berry via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 18 12:00:33 PST 2016
gberry updated this revision to Diff 45200.
gberry added a comment.
Remove empty if.
http://reviews.llvm.org/D16299
Files:
cmake/modules/VersionFromVCS.cmake
Index: cmake/modules/VersionFromVCS.cmake
===================================================================
--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -27,16 +27,20 @@
find_program(git_executable NAMES git git.exe git.cmd)
if( git_executable )
set(is_git_svn_rev_exact false)
- execute_process(COMMAND ${git_executable} svn log --limit=1 --oneline
+ execute_process(COMMAND
+ ${git_executable} svn info
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
TIMEOUT 5
RESULT_VARIABLE git_result
OUTPUT_VARIABLE git_output)
if( git_result EQUAL 0 )
- string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
- string(LENGTH "${git_svn_rev}" rev_length)
- math(EXPR rev_length "${rev_length}-1")
- string(SUBSTRING "${git_svn_rev}" 1 ${rev_length} git_svn_rev_number)
+ string(REGEX MATCH "URL: ([^ \n]*)" svn_url ${git_output})
+ if(svn_url)
+ set(LLVM_REPOSITORY ${CMAKE_MATCH_1} PARENT_SCOPE)
+ endif()
+
+ string(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+ "\\2" git_svn_rev_number "${git_output}")
set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
set(git_svn_rev "-svn-${git_svn_rev}")
@@ -69,18 +73,6 @@
set(result "${result}${git_svn_rev}")
endif()
- execute_process(COMMAND
- ${git_executable} svn info
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- TIMEOUT 5
- RESULT_VARIABLE git_result
- OUTPUT_VARIABLE git_output)
- if( git_result EQUAL 0)
- string(REGEX MATCH "URL: ([^ \n]*)" svn_url ${git_output})
- if(svn_url)
- set(LLVM_REPOSITORY ${CMAKE_MATCH_1} PARENT_SCOPE)
- endif()
- endif()
endif()
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16299.45200.patch
Type: text/x-patch
Size: 1919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160118/afe1ff1c/attachment.bin>
More information about the llvm-commits
mailing list