2004-09-07 13:17:15 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
2006-03-10 20:03:09 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
2004-09-07 13:17:15 +00:00
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
|
|
|
|
#ifndef cmCTestUpdateHandler_h
|
|
|
|
#define cmCTestUpdateHandler_h
|
|
|
|
|
|
|
|
|
2005-01-27 16:43:22 +00:00
|
|
|
#include "cmCTestGenericHandler.h"
|
2004-09-07 13:17:15 +00:00
|
|
|
#include "cmListFileCache.h"
|
|
|
|
|
2005-05-03 18:58:13 +00:00
|
|
|
#if defined(__sgi) && !defined(__GNUC__)
|
|
|
|
# pragma set woff 1375 /* base class destructor not virtual */
|
|
|
|
#endif
|
|
|
|
|
2004-09-07 13:17:15 +00:00
|
|
|
/** \class cmCTestUpdateHandler
|
|
|
|
* \brief A class that handles ctest -S invocations
|
|
|
|
*
|
|
|
|
*/
|
2005-01-27 16:43:22 +00:00
|
|
|
class cmCTestUpdateHandler : public cmCTestGenericHandler
|
2004-09-07 13:17:15 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-06-17 17:04:56 +00:00
|
|
|
cmTypeMacro(cmCTestUpdateHandler, cmCTestGenericHandler);
|
2004-09-07 13:17:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The main entry point for this class
|
|
|
|
*/
|
2005-01-27 20:54:47 +00:00
|
|
|
int ProcessHandler();
|
2006-03-10 20:03:09 +00:00
|
|
|
|
2004-09-07 13:17:15 +00:00
|
|
|
cmCTestUpdateHandler();
|
2005-02-16 18:28:47 +00:00
|
|
|
|
|
|
|
enum {
|
2005-06-17 17:04:56 +00:00
|
|
|
e_UNKNOWN = 0,
|
2005-02-16 18:28:47 +00:00
|
|
|
e_CVS,
|
2005-06-17 17:04:56 +00:00
|
|
|
e_SVN,
|
2009-04-22 13:19:06 +00:00
|
|
|
e_GIT,
|
2005-06-17 17:04:56 +00:00
|
|
|
e_LAST
|
2005-02-16 18:28:47 +00:00
|
|
|
};
|
2005-06-17 17:04:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize handler
|
|
|
|
*/
|
|
|
|
virtual void Initialize();
|
2006-03-10 20:03:09 +00:00
|
|
|
|
2004-09-07 13:17:15 +00:00
|
|
|
private:
|
2005-02-16 18:28:47 +00:00
|
|
|
// Some structures needed for update
|
2006-03-10 20:03:09 +00:00
|
|
|
struct StringPair :
|
2004-09-07 13:17:15 +00:00
|
|
|
public std::pair<std::string, std::string>{};
|
|
|
|
struct UpdateFiles : public std::vector<StringPair>{};
|
2005-02-16 18:28:47 +00:00
|
|
|
|
|
|
|
// Determine the type of version control
|
|
|
|
int DetermineType(const char* cmd, const char* type);
|
2009-02-24 14:09:14 +00:00
|
|
|
|
2009-02-24 14:09:43 +00:00
|
|
|
// The VCS command to update the working tree.
|
|
|
|
std::string UpdateCommand;
|
|
|
|
int UpdateType;
|
|
|
|
|
2009-02-24 14:09:14 +00:00
|
|
|
bool InitialCheckout(std::ostream& ofs);
|
2009-02-24 14:09:43 +00:00
|
|
|
int DetectVCS(const char* dir);
|
|
|
|
bool SelectVCS();
|
2004-09-07 13:17:15 +00:00
|
|
|
};
|
|
|
|
|
2005-05-03 18:58:13 +00:00
|
|
|
#if defined(__sgi) && !defined(__GNUC__)
|
|
|
|
# pragma reset woff 1375 /* base class destructor not virtual */
|
|
|
|
#endif
|
|
|
|
|
2004-09-07 13:17:15 +00:00
|
|
|
#endif
|