BUG: Fix return value of ctest_update

The CTest version control refactoring broke the value returned for the
ctest_update command's RETURN_VALUE argument.  The value is supposed to
be the number of files updated, but the refactoring accidentally made it
the number of locally modified files after the update.
This commit is contained in:
Brad King 2009-03-20 14:19:56 -04:00
parent 1ce28d1db8
commit d66436e2e4
2 changed files with 4 additions and 4 deletions

View File

@ -64,8 +64,7 @@ public:
"Updates the given source directory and stores results in Update.xml. "
"If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used. "
"The RETURN_VALUE option specifies a variable in which to store the "
"result, which is -1 on error, non-negative for success, and positive "
"if there are local modifications in the work tree."
"result, which is the number of files updated or -1 on error."
;
}

View File

@ -248,7 +248,8 @@ int cmCTestUpdateHandler::ProcessHandler()
vc->WriteXML(os);
int localModifications = 0;
if(int numUpdated = vc->GetPathCount(cmCTestVC::PathUpdated))
int numUpdated = vc->GetPathCount(cmCTestVC::PathUpdated);
if(numUpdated)
{
cmCTestLog(this->CTest, HANDLER_OUTPUT,
" Found " << numUpdated << " updated files\n");
@ -290,7 +291,7 @@ int cmCTestUpdateHandler::ProcessHandler()
}
os << "</UpdateReturnStatus>" << std::endl;
os << "</Update>" << std::endl;
return localModifications;
return numUpdated;
}
//----------------------------------------------------------------------