Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CTest/cmCTestGlobalVC.h
5000 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <iosfwd>
8
#include <list>
9
#include <map>
10
#include <string>
11
#include <vector>
12
13
#include "cmCTestVC.h"
14
15
class cmCTest;
16
class cmMakefile;
17
class cmXMLWriter;
18
19
/** \class cmCTestGlobalVC
20
* \brief Base class for handling globally-versioned trees
21
*
22
*/
23
class cmCTestGlobalVC : public cmCTestVC
24
{
25
public:
26
/** Construct with a CTest instance and update log stream. */
27
cmCTestGlobalVC(cmCTest* ctest, cmMakefile* mf, std::ostream& log);
28
29
~cmCTestGlobalVC() override;
30
31
protected:
32
// Implement cmCTestVC internal API.
33
bool WriteXMLUpdates(cmXMLWriter& xml) override;
34
35
void SetNewRevision(std::string const& revision) override;
36
37
/** Represent a vcs-reported action for one path in a revision. */
38
struct Change
39
{
40
char Action;
41
std::string Path;
42
Change(char a = '?')
43
: Action(a)
44
{
45
}
46
};
47
48
// Update status for files in each directory.
49
class Directory : public std::map<std::string, File>
50
{
51
};
52
std::map<std::string, Directory> Dirs;
53
54
// Old and new repository revisions.
55
std::string OldRevision;
56
std::string NewRevision;
57
58
// Information known about old revision.
59
Revision PriorRev;
60
61
// Information about revisions from a svn log.
62
std::list<Revision> Revisions;
63
64
virtual char const* LocalPath(std::string const& path);
65
66
virtual void DoRevision(Revision const& revision,
67
std::vector<Change> const& changes);
68
virtual void DoModification(PathStatus status, std::string const& path);
69
virtual bool LoadModifications() = 0;
70
virtual bool LoadRevisions() = 0;
71
72
virtual void WriteXMLGlobal(cmXMLWriter& xml);
73
void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
74
Directory const& dir);
75
};
76
77