mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
CTestUpdate: Prefer concrete variables over map entries
This commit is contained in:
@@ -79,7 +79,7 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
|
||||
this->SetError("source directory not specified. Please use SOURCE tag");
|
||||
return nullptr;
|
||||
}
|
||||
handler->SetOption("SourceDirectory", source_dir);
|
||||
handler->SourceDirectory = source_dir;
|
||||
handler->SetQuiet(this->Quiet);
|
||||
return handler;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "cmGeneratedFileStream.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmValue.h"
|
||||
#include "cmVersion.h"
|
||||
#include "cmXMLWriter.h"
|
||||
|
||||
@@ -109,8 +108,7 @@ int cmCTestUpdateHandler::ProcessHandler()
|
||||
static_cast<void>(fixLocale);
|
||||
|
||||
// Get source dir
|
||||
cmValue sourceDirectory = this->GetOption("SourceDirectory");
|
||||
if (!sourceDirectory) {
|
||||
if (this->SourceDirectory.empty()) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
"Cannot find SourceDirectory key in the DartConfiguration.tcl"
|
||||
<< std::endl);
|
||||
@@ -123,7 +121,7 @@ int cmCTestUpdateHandler::ProcessHandler()
|
||||
}
|
||||
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
|
||||
" Updating the repository: " << *sourceDirectory
|
||||
" Updating the repository: " << this->SourceDirectory
|
||||
<< std::endl,
|
||||
this->Quiet);
|
||||
|
||||
@@ -163,7 +161,7 @@ int cmCTestUpdateHandler::ProcessHandler()
|
||||
break;
|
||||
}
|
||||
vc->SetCommandLineTool(this->UpdateCommand);
|
||||
vc->SetSourceDirectory(*sourceDirectory);
|
||||
vc->SetSourceDirectory(this->SourceDirectory);
|
||||
|
||||
// Cleanup the working tree.
|
||||
vc->Cleanup();
|
||||
@@ -301,7 +299,7 @@ bool cmCTestUpdateHandler::SelectVCS()
|
||||
this->UpdateCommand = this->CTest->GetCTestConfiguration("UpdateCommand");
|
||||
|
||||
// Detect the VCS managing the source tree.
|
||||
this->UpdateType = this->DetectVCS(this->GetOption("SourceDirectory"));
|
||||
this->UpdateType = this->DetectVCS(this->SourceDirectory);
|
||||
if (this->UpdateType == e_UNKNOWN) {
|
||||
// The source tree does not have a recognized VCS. Check the
|
||||
// configuration value or command name.
|
||||
|
||||
@@ -57,8 +57,11 @@ private:
|
||||
|
||||
// The VCS command to update the working tree.
|
||||
std::string UpdateCommand;
|
||||
std::string SourceDirectory;
|
||||
int UpdateType;
|
||||
|
||||
int DetectVCS(const std::string& dir);
|
||||
bool SelectVCS();
|
||||
|
||||
friend class cmCTestUpdateCommand;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user