ctest_update: Add CTEST_UPDATE_VERSION_ONLY option to only note the version

This allows ctest_update to get the current version without actually
changing the repository.  This is useful when using Jenkins or an
external project to update the source to a specific version, but you
still want the current version to show up in CDash.
This commit is contained in:
Bill Hoffman
2014-08-13 13:45:08 -04:00
committed by Brad King
parent ffc1935a73
commit 39b5df2f37
8 changed files with 89 additions and 11 deletions

View File

@@ -55,6 +55,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
"GITUpdateOptions", "CTEST_GIT_UPDATE_OPTIONS");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"GITUpdateCustom", "CTEST_GIT_UPDATE_CUSTOM");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"UpdateVersionOnly", "CTEST_UPDATE_VERSION_ONLY");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"HGCommand", "CTEST_HG_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,

View File

@@ -166,10 +166,17 @@ void cmCTestVC::CleanupImpl()
//----------------------------------------------------------------------------
bool cmCTestVC::Update()
{
this->NoteOldRevision();
this->Log << "--- Begin Update ---\n";
bool result = this->UpdateImpl();
this->Log << "--- End Update ---\n";
bool result = true;
// if update version only is on then do not actually update,
// just note the current version and finish
if(!cmSystemTools::IsOn(
this->CTest->GetCTestConfiguration("UpdateVersionOnly").c_str()))
{
this->NoteOldRevision();
this->Log << "--- Begin Update ---\n";
result = this->UpdateImpl();
this->Log << "--- End Update ---\n";
}
this->NoteNewRevision();
return result;
}