From 74eb86c4a33140f71d9d248bb26ba0ff92fa0989 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2011 17:02:22 -0400 Subject: Fix CTest.UpdateSVN with Subversion 1.7 (#12535) The test adds a subdirectory with svn add subdir svn add ... subdir/foo.txt subdir/bar.txt Subversion 1.7 fails on the second command with svn: warning: W150002: '.../subdir/foo.txt' is already under version control svn: warning: W150002: '.../subdir/bar.txt' is already under version control svn: E200009: Could not add all targets because some targets don't exist because it considers adding an already-versioned file to be an error. Avoid the problem by using svn add --depth=empty subdir to add the subdirectory without the files it contains. --- Tests/CTestUpdateSVN.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index 97b2a07..e18dfc9 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -63,7 +63,7 @@ update_content(user-source files_added files_removed dirs_added) if(dirs_added) run_child( WORKING_DIRECTORY ${TOP}/user-source - COMMAND ${SVNCMD} add ${dirs_added} + COMMAND ${SVNCMD} add --depth=empty ${dirs_added} ) endif(dirs_added) run_child( -- cgit v0.12 From 6d79b50518d82a9bb116e527935d12498549fce9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2011 17:33:29 -0400 Subject: Teach CTest.UpdateSVN to detect svn add --depth before using it Older svn versions do not have the --depth option for "svn add". Fortunately we do not need it for versions that old. Look for the option and use it only when available. --- Tests/CTestUpdateSVN.cmake.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index e18dfc9..edafb4ef 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -23,6 +23,16 @@ file(MAKE_DIRECTORY ${TOP}/config) set(SVNCMD ${SVN} --config-dir ${TOP}/config) set(SVNUSER --username "test author" --non-interactive) +# Configure for this svn version. +execute_process( + COMMAND ${SVN} help add OUTPUT_VARIABLE help_add ERROR_VARIABLE help_add + ) +if("${help_add}" MATCHES "--depth") + set(depth_empty "--depth=empty") +else() + set(depth_empty "") +endif() + #----------------------------------------------------------------------------- # Initialize the testing directory. message("Creating test directory...") @@ -63,7 +73,7 @@ update_content(user-source files_added files_removed dirs_added) if(dirs_added) run_child( WORKING_DIRECTORY ${TOP}/user-source - COMMAND ${SVNCMD} add --depth=empty ${dirs_added} + COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added} ) endif(dirs_added) run_child( -- cgit v0.12