summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-23 20:59:39 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-23 20:59:39 (GMT)
commita6c07844895332587837b8c18737146a16be7559 (patch)
treed95cdc967d569e0c6b9f5e0a1b7d015bc87528b4 /Source/CTest
parent430b376a5b892d8536e78eb20c576db6923046e0 (diff)
downloadCMake-a6c07844895332587837b8c18737146a16be7559.zip
CMake-a6c07844895332587837b8c18737146a16be7559.tar.gz
CMake-a6c07844895332587837b8c18737146a16be7559.tar.bz2
ENH: Refactor quoting of VCS tool command
Previously we pre-quoted the command line tool path. This avoids it by quoting the command everywhere it is used, thus preserving access to the original, unquoted command.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 878e577..6b8d2b9 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -461,8 +461,6 @@ int cmCTestUpdateHandler::ProcessHandler()
bool res = true;
- updateCommand = "\"" + updateCommand + "\"";
-
// First, check what the current state of repository is
std::string command = "";
switch( updateType )
@@ -471,7 +469,7 @@ int cmCTestUpdateHandler::ProcessHandler()
// TODO: CVS - for now just leave empty
break;
case cmCTestUpdateHandler::e_SVN:
- command = updateCommand + " cleanup";
+ command = "\"" + updateCommand + "\" cleanup";
break;
}
@@ -513,7 +511,7 @@ int cmCTestUpdateHandler::ProcessHandler()
// TODO: CVS - for now just leave empty
break;
case cmCTestUpdateHandler::e_SVN:
- command = updateCommand + " info";
+ command = "\"" + updateCommand + "\" info";
break;
}
@@ -598,7 +596,7 @@ int cmCTestUpdateHandler::ProcessHandler()
switch( updateType )
{
case cmCTestUpdateHandler::e_CVS:
- command = updateCommand + " -z3 update " + updateOptions +
+ command = "\"" + updateCommand + "\" -z3 update " + updateOptions +
" " + extra_update_opts;
ofs << "* Update repository: " << std::endl;
ofs << " Command: " << command.c_str() << std::endl;
@@ -610,7 +608,7 @@ int cmCTestUpdateHandler::ProcessHandler()
case cmCTestUpdateHandler::e_SVN:
{
std::string partialOutput;
- command = updateCommand + " update " + updateOptions +
+ command = "\"" + updateCommand + "\" update " + updateOptions +
" " + extra_update_opts;
ofs << "* Update repository: " << std::endl;
ofs << " Command: " << command.c_str() << std::endl;
@@ -620,7 +618,7 @@ int cmCTestUpdateHandler::ProcessHandler()
ofs << " Output: " << partialOutput.c_str() << std::endl;
ofs << " Errors: " << errors.c_str() << std::endl;
goutput = partialOutput;
- command = updateCommand + " status";
+ command = "\"" + updateCommand + "\" status";
ofs << "* Status repository: " << std::endl;
ofs << " Command: " << command.c_str() << std::endl;
res = this->CTest->RunCommand(command.c_str(), &partialOutput,
@@ -772,22 +770,22 @@ int cmCTestUpdateHandler::ProcessHandler()
switch ( updateType )
{
case cmCTestUpdateHandler::e_CVS:
- logcommand = updateCommand + " -z3 log -N \"" + file + "\"";
+ logcommand = "\""+updateCommand+"\" -z3 log -N \"" + file + "\"";
break;
case cmCTestUpdateHandler::e_SVN:
if ( svn_latest_revision > 0 &&
svn_latest_revision > svn_current_revision )
{
cmOStringStream logCommandStream;
- logCommandStream << updateCommand << " log -r "
+ logCommandStream << "\"" << updateCommand << "\" log -r "
<< svn_current_revision << ":" << svn_latest_revision
<< " --xml \"" << file << "\"";
logcommand = logCommandStream.str();
}
else
{
- logcommand = updateCommand +
- " status --verbose \"" + file + "\"";
+ logcommand = "\"" + updateCommand +
+ "\" status --verbose \"" + file + "\"";
svn_use_status = 1;
}
break;