diff options
author | Brad King <brad.king@kitware.com> | 2009-07-10 15:08:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-10 15:08:05 (GMT) |
commit | d4d467dbd5c4a1590333eeeb3082ad46dc9698df (patch) | |
tree | 9ade1437126f78d4d1a5d292848df45ce33cadda /Source/CTest/cmCTestUpdateHandler.cxx | |
parent | c0e8c0f5aa004fb7f8c1804a5e29bd22862c9360 (diff) | |
download | CMake-d4d467dbd5c4a1590333eeeb3082ad46dc9698df.zip CMake-d4d467dbd5c4a1590333eeeb3082ad46dc9698df.tar.gz CMake-d4d467dbd5c4a1590333eeeb3082ad46dc9698df.tar.bz2 |
ENH: Teach CTest to handle Mercurial repositories
This creates cmCTestHG to drive CTest Update handling on hg-based work
trees. Currently we always update to the head of the remote tracking
branch (hg pull), so the nightly start time is ignored for Nightly
builds. A later change will address this.
See issue #7879. Patch from Emmanuel Christophe. I modified the patch
slightly for code style, to finish up some parsing details, and to fix
the test.
Diffstat (limited to 'Source/CTest/cmCTestUpdateHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestUpdateHandler.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index d3930d7..749daa5 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -32,6 +32,7 @@ #include "cmCTestSVN.h" #include "cmCTestBZR.h" #include "cmCTestGIT.h" +#include "cmCTestHG.h" #include <cmsys/auto_ptr.hxx> @@ -54,7 +55,8 @@ static const char* cmCTestUpdateHandlerUpdateStrings[] = "CVS", "SVN", "BZR", - "GIT" + "GIT", + "HG" }; static const char* cmCTestUpdateHandlerUpdateToString(int type) @@ -145,6 +147,10 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) { return cmCTestUpdateHandler::e_GIT; } + if ( stype.find("hg") != std::string::npos ) + { + return cmCTestUpdateHandler::e_HG; + } } else { @@ -167,6 +173,10 @@ int cmCTestUpdateHandler::DetermineType(const char* cmd, const char* type) { return cmCTestUpdateHandler::e_GIT; } + if ( stype.find("hg") != std::string::npos ) + { + return cmCTestUpdateHandler::e_HG; + } } return cmCTestUpdateHandler::e_UNKNOWN; } @@ -226,6 +236,7 @@ int cmCTestUpdateHandler::ProcessHandler() case e_SVN: vc.reset(new cmCTestSVN(this->CTest, ofs)); break; case e_BZR: vc.reset(new cmCTestBZR(this->CTest, ofs)); break; case e_GIT: vc.reset(new cmCTestGIT(this->CTest, ofs)); break; + case e_HG: vc.reset(new cmCTestHG(this->CTest, ofs)); break; default: vc.reset(new cmCTestVC(this->CTest, ofs)); break; } vc->SetCommandLineTool(this->UpdateCommand); @@ -371,6 +382,12 @@ int cmCTestUpdateHandler::DetectVCS(const char* dir) { return cmCTestUpdateHandler::e_GIT; } + sourceDirectory = dir; + sourceDirectory += "/.hg"; + if ( cmSystemTools::FileExists(sourceDirectory.c_str()) ) + { + return cmCTestUpdateHandler::e_HG; + } return cmCTestUpdateHandler::e_UNKNOWN; } @@ -400,6 +417,7 @@ bool cmCTestUpdateHandler::SelectVCS() case e_SVN: key = "SVNCommand"; break; case e_BZR: key = "BZRCommand"; break; case e_GIT: key = "GITCommand"; break; + case e_HG: key = "HGCommand"; break; default: break; } if (key) |