2004-09-07 17:17:15 +04: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 23:03:09 +03:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
2004-09-07 17:17:15 +04:00
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
|
|
|
|
#ifndef cmCTestUpdateHandler_h
|
|
|
|
#define cmCTestUpdateHandler_h
|
|
|
|
|
|
|
|
|
2005-01-27 19:43:22 +03:00
|
|
|
#include "cmCTestGenericHandler.h"
|
2004-09-07 17:17:15 +04:00
|
|
|
#include "cmListFileCache.h"
|
|
|
|
|
2005-05-03 22:58:13 +04:00
|
|
|
#if defined(__sgi) && !defined(__GNUC__)
|
|
|
|
# pragma set woff 1375 /* base class destructor not virtual */
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
*/
|
2005-01-27 23:54:47 +03:00
|
|
|
int ProcessHandler();
|
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
|
|
|
|
|
|
|
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,
|
|
|
|
e_LAST
|
2005-02-16 21:28:47 +03:00
|
|
|
};
|
2005-06-17 21:04:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize handler
|
|
|
|
*/
|
|
|
|
virtual void Initialize();
|
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
|
2006-03-10 23:03:09 +03:00
|
|
|
struct StringPair :
|
2004-09-07 17:17:15 +04:00
|
|
|
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;
|
|
|
|
|
2009-02-24 17:09:14 +03:00
|
|
|
bool InitialCheckout(std::ostream& ofs);
|
2009-02-24 17:09:43 +03:00
|
|
|
int DetectVCS(const char* dir);
|
|
|
|
bool SelectVCS();
|
2004-09-07 17:17:15 +04:00
|
|
|
};
|
|
|
|
|
2005-05-03 22:58:13 +04:00
|
|
|
#if defined(__sgi) && !defined(__GNUC__)
|
|
|
|
# pragma reset woff 1375 /* base class destructor not virtual */
|
|
|
|
#endif
|
|
|
|
|
2004-09-07 17:17:15 +04:00
|
|
|
#endif
|