ENH: Reorganize a bit and make sure to report an error if there are modified files or conflicts

This commit is contained in:
Andy Cedilnik 2005-04-21 18:23:28 -04:00
parent 2f4e516e23
commit dadd974d97
1 changed files with 21 additions and 11 deletions

View File

@ -204,6 +204,7 @@ int cmCTestUpdateHandler::ProcessHandler()
int count = 0;
int updateType = e_CVS;
std::string::size_type cc, kk;
bool updateProducedError = false;
// Get source dir
@ -390,6 +391,10 @@ int cmCTestUpdateHandler::ProcessHandler()
ofs << goutput << std::endl;;
}
}
if ( !res || retVal )
{
updateProducedError = true;
}
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
<< "<Update mode=\"Client\" Generator=\"ctest-"
@ -401,15 +406,7 @@ int cmCTestUpdateHandler::ProcessHandler()
<< m_CTest->GetTestModelString() << "</BuildStamp>" << std::endl;
os << "\t<StartDateTime>" << start_time << "</StartDateTime>\n"
<< "\t<UpdateCommand>" << m_CTest->MakeXMLSafe(command)
<< "</UpdateCommand>\n"
<< "\t<UpdateReturnStatus>";
if ( !res || retVal )
{
os << "Update error: ";
os << m_CTest->MakeXMLSafe(goutput);
std::cerr << "Update with command: " << command << " failed" << std::endl;
}
os << "</UpdateReturnStatus>" << std::endl;
<< "</UpdateCommand>\n";
// Even though it failed, we may have some useful information. Try to continue...
std::vector<cmStdString> lines;
@ -806,8 +803,21 @@ int cmCTestUpdateHandler::ProcessHandler()
os << "\t<EndDateTime>" << end_time << "</EndDateTime>\n"
<< "<ElapsedMinutes>" <<
static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0
<< "</ElapsedMinutes>"
<< "</Update>" << std::endl;
<< "</ElapsedMinutes>\n"
<< "\t<UpdateReturnStatus>";
if ( num_modified > 0 || num_conflicting > 0 )
{
os << "Update error: There are modified or conflicting files in the repository";
std::cerr << " There are modified or conflicting files in the repository" << std::endl;
}
if ( !res || retVal )
{
os << "Update error: ";
os << m_CTest->MakeXMLSafe(goutput);
std::cerr << " Update with command: " << command << " failed" << std::endl;
}
os << "</UpdateReturnStatus>" << std::endl;
os << "</Update>" << std::endl;
if ( ofs )
{