2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2004-09-07 17:17:15 +04:00
|
|
|
#ifndef cmCTestUpdateHandler_h
|
|
|
|
#define cmCTestUpdateHandler_h
|
|
|
|
|
2016-08-24 23:01:40 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2005-01-27 19:43:22 +03:00
|
|
|
#include "cmCTestGenericHandler.h"
|
2016-08-24 23:01:40 +03:00
|
|
|
#include "cmTypeMacro.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2016-08-24 23:01:40 +03:00
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
2004-09-07 17:17:15 +04:00
|
|
|
|
|
|
|
/** \class cmCTestUpdateHandler
|
|
|
|
* \brief A class that handles ctest -S invocations
|
|
|
|
*
|
|
|
|
*/
|
2005-01-27 19:43:22 +03:00
|
|
|
class cmCTestUpdateHandler : public cmCTestGenericHandler
|
2004-09-07 17:17:15 +04:00
|
|
|
{
|
|
|
|
public:
|
2005-06-17 21:04:56 +04:00
|
|
|
cmTypeMacro(cmCTestUpdateHandler, cmCTestGenericHandler);
|
2004-09-07 17:17:15 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The main entry point for this class
|
|
|
|
*/
|
2016-06-27 22:25:27 +03:00
|
|
|
int ProcessHandler() CM_OVERRIDE;
|
2006-03-10 23:03:09 +03:00
|
|
|
|
2004-09-07 17:17:15 +04:00
|
|
|
cmCTestUpdateHandler();
|
2005-02-16 21:28:47 +03:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
enum
|
|
|
|
{
|
2005-06-17 21:04:56 +04:00
|
|
|
e_UNKNOWN = 0,
|
2005-02-16 21:28:47 +03:00
|
|
|
e_CVS,
|
2005-06-17 21:04:56 +04:00
|
|
|
e_SVN,
|
2009-05-15 00:13:52 +04:00
|
|
|
e_BZR,
|
2009-04-22 17:19:06 +04:00
|
|
|
e_GIT,
|
2009-07-10 19:08:05 +04:00
|
|
|
e_HG,
|
2013-10-23 02:11:22 +04:00
|
|
|
e_P4,
|
2005-06-17 21:04:56 +04:00
|
|
|
e_LAST
|
2005-02-16 21:28:47 +03:00
|
|
|
};
|
2005-06-17 21:04:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize handler
|
|
|
|
*/
|
2016-06-27 22:25:27 +03:00
|
|
|
void Initialize() CM_OVERRIDE;
|
2006-03-10 23:03:09 +03:00
|
|
|
|
2004-09-07 17:17:15 +04:00
|
|
|
private:
|
2005-02-16 21:28:47 +03:00
|
|
|
// Some structures needed for update
|
2016-05-16 17:34:04 +03:00
|
|
|
struct StringPair : public std::pair<std::string, std::string>
|
|
|
|
{
|
|
|
|
};
|
|
|
|
struct UpdateFiles : public std::vector<StringPair>
|
|
|
|
{
|
|
|
|
};
|
2005-02-16 21:28:47 +03:00
|
|
|
|
|
|
|
// Determine the type of version control
|
|
|
|
int DetermineType(const char* cmd, const char* type);
|
2009-02-24 17:09:14 +03:00
|
|
|
|
2009-02-24 17:09:43 +03:00
|
|
|
// The VCS command to update the working tree.
|
|
|
|
std::string UpdateCommand;
|
|
|
|
int UpdateType;
|
|
|
|
|
|
|
|
int DetectVCS(const char* dir);
|
|
|
|
bool SelectVCS();
|
2004-09-07 17:17:15 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|