summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestUpdateHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-04-22 13:19:06 (GMT)
committerBrad King <brad.king@kitware.com>2009-04-22 13:19:06 (GMT)
commit9c17cbeb44f4e47dd8f6a2cda57c3967b293cdfe (patch)
treef31f0e20ee3c74d471870b83e571c70c45ef6141 /Source/CTest/cmCTestUpdateHandler.cxx
parentd25289ad9254c67d8231c6582b4b9a35daa8297c (diff)
downloadCMake-9c17cbeb44f4e47dd8f6a2cda57c3967b293cdfe.zip
CMake-9c17cbeb44f4e47dd8f6a2cda57c3967b293cdfe.tar.gz
CMake-9c17cbeb44f4e47dd8f6a2cda57c3967b293cdfe.tar.bz2
ENH: Teach CTest to handle git repositories
This creates cmCTestGIT to drive CTest Update handling on git-based work trees. Currently we always update to the head of the remote tracking branch (git pull), so the nightly start time is ignored for Nightly builds. A later change will address this. See issue #6994.
Diffstat (limited to 'Source/CTest/cmCTestUpdateHandler.cxx')
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 41a6540..edd0ac4 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -30,6 +30,7 @@
#include "cmCTestVC.h"
#include "cmCTestCVS.h"
#include "cmCTestSVN.h"
+#include "cmCTestGIT.h"
#include <cmsys/auto_ptr.hxx>
@@ -50,7 +51,8 @@ static const char* cmCTestUpdateHandlerUpdateStrings[] =
{
"Unknown",
"CVS",
- "SVN"
+ "SVN",
+ "GIT"
};
static const char* cmCTestUpdateHandlerUpdateToString(int type)
@@ -133,6 +135,10 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type)
{
return cmCTestUpdateHandler::e_SVN;
}
+ if ( stype.find("git") != std::string::npos )
+ {
+ return cmCTestUpdateHandler::e_GIT;
+ }
}
else
{
@@ -147,6 +153,10 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type)
{
return cmCTestUpdateHandler::e_SVN;
}
+ if ( stype.find("git") != std::string::npos )
+ {
+ return cmCTestUpdateHandler::e_GIT;
+ }
}
return cmCTestUpdateHandler::e_UNKNOWN;
}
@@ -204,6 +214,7 @@ int cmCTestUpdateHandler::ProcessHandler()
{
case e_CVS: vc.reset(new cmCTestCVS(this->CTest, ofs)); break;
case e_SVN: vc.reset(new cmCTestSVN(this->CTest, ofs)); break;
+ case e_GIT: vc.reset(new cmCTestGIT(this->CTest, ofs)); break;
default: vc.reset(new cmCTestVC(this->CTest, ofs)); break;
}
vc->SetCommandLineTool(this->UpdateCommand);
@@ -337,6 +348,12 @@ int cmCTestUpdateHandler::DetectVCS(const char* dir)
{
return cmCTestUpdateHandler::e_CVS;
}
+ sourceDirectory = dir;
+ sourceDirectory += "/.git";
+ if ( cmSystemTools::FileExists(sourceDirectory.c_str()) )
+ {
+ return cmCTestUpdateHandler::e_GIT;
+ }
return cmCTestUpdateHandler::e_UNKNOWN;
}
@@ -364,6 +381,7 @@ bool cmCTestUpdateHandler::SelectVCS()
{
case e_CVS: key = "CVSCommand"; break;
case e_SVN: key = "SVNCommand"; break;
+ case e_GIT: key = "GITCommand"; break;
default: break;
}
if (key)