diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2014-08-13 17:45:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-08-18 15:21:36 (GMT) |
commit | 39b5df2f3714c32d498fcb7c88f5bda456f75cb3 (patch) | |
tree | 837969d25d89a20025ced7cbecbe73236cd7a650 /Source | |
parent | ffc1935a73267cfe74e5d5492c9621ccf6c66112 (diff) | |
download | CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.zip CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.tar.gz CMake-39b5df2f3714c32d498fcb7c88f5bda456f75cb3.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestUpdateCommand.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestVC.cxx | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx index 5408a8a..f87466d 100644 --- a/Source/CTest/cmCTestUpdateCommand.cxx +++ b/Source/CTest/cmCTestUpdateCommand.cxx @@ -56,6 +56,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler() 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, "HGUpdateOptions", "CTEST_HG_UPDATE_OPTIONS"); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index f89fa2b..15f796f 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -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; } |