2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc.
|
2009-04-22 17:18:19 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2009-04-22 17:18:19 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2009-04-22 17:18:19 +04:00
|
|
|
#ifndef cmCTestGlobalVC_h
|
|
|
|
#define cmCTestGlobalVC_h
|
|
|
|
|
2016-08-24 23:01:40 +03:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
|
2009-04-22 17:18:19 +04:00
|
|
|
#include "cmCTestVC.h"
|
|
|
|
|
2016-08-24 23:01:40 +03:00
|
|
|
#include <iosfwd>
|
2015-01-12 23:17:55 +03:00
|
|
|
#include <list>
|
2016-08-24 01:29:15 +03:00
|
|
|
#include <map>
|
2016-08-24 23:01:40 +03:00
|
|
|
#include <string>
|
2016-08-24 01:29:15 +03:00
|
|
|
#include <vector>
|
2015-01-12 23:17:55 +03:00
|
|
|
|
2016-08-24 23:01:40 +03:00
|
|
|
class cmCTest;
|
|
|
|
class cmXMLWriter;
|
|
|
|
|
2009-04-22 17:18:19 +04:00
|
|
|
/** \class cmCTestGlobalVC
|
|
|
|
* \brief Base class for handling globally-versioned trees
|
|
|
|
*
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
class cmCTestGlobalVC : public cmCTestVC
|
2009-04-22 17:18:19 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Construct with a CTest instance and update log stream. */
|
|
|
|
cmCTestGlobalVC(cmCTest* ctest, std::ostream& log);
|
|
|
|
|
2016-06-27 22:25:27 +03:00
|
|
|
~cmCTestGlobalVC() CM_OVERRIDE;
|
2009-04-22 17:18:19 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Implement cmCTestVC internal API.
|
2016-06-27 22:25:27 +03:00
|
|
|
bool WriteXMLUpdates(cmXMLWriter& xml) CM_OVERRIDE;
|
2009-04-22 17:18:19 +04:00
|
|
|
|
|
|
|
/** Represent a vcs-reported action for one path in a revision. */
|
|
|
|
struct Change
|
|
|
|
{
|
|
|
|
char Action;
|
|
|
|
std::string Path;
|
2016-05-16 17:34:04 +03:00
|
|
|
Change(char a = '?')
|
|
|
|
: Action(a)
|
|
|
|
{
|
|
|
|
}
|
2009-04-22 17:18:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Update status for files in each directory.
|
2016-05-16 17:34:04 +03:00
|
|
|
class Directory : public std::map<std::string, File>
|
|
|
|
{
|
|
|
|
};
|
2014-02-10 09:21:34 +04:00
|
|
|
std::map<std::string, Directory> Dirs;
|
2009-04-22 17:18:19 +04:00
|
|
|
|
|
|
|
// Old and new repository revisions.
|
|
|
|
std::string OldRevision;
|
|
|
|
std::string NewRevision;
|
|
|
|
|
|
|
|
// Information known about old revision.
|
|
|
|
Revision PriorRev;
|
|
|
|
|
|
|
|
// Information about revisions from a svn log.
|
|
|
|
std::list<Revision> Revisions;
|
|
|
|
|
|
|
|
virtual const char* LocalPath(std::string const& path);
|
|
|
|
|
|
|
|
virtual void DoRevision(Revision const& revision,
|
|
|
|
std::vector<Change> const& changes);
|
|
|
|
virtual void DoModification(PathStatus status, std::string const& path);
|
|
|
|
virtual void LoadModifications() = 0;
|
|
|
|
virtual void LoadRevisions() = 0;
|
|
|
|
|
2015-05-24 01:33:24 +03:00
|
|
|
virtual void WriteXMLGlobal(cmXMLWriter& xml);
|
|
|
|
void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
|
2009-04-22 17:18:19 +04:00
|
|
|
Directory const& dir);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|