2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
#include "cmCTestGlobalVC.h"
|
|
|
|
|
2016-10-30 18:24:19 +01:00
|
|
|
class cmCTest;
|
|
|
|
|
2009-10-04 10:30:41 +03:00
|
|
|
/** \class cmCTestGIT
|
|
|
|
* \brief Interaction with git command-line tool
|
|
|
|
*
|
|
|
|
*/
|
2016-07-09 11:21:54 +02:00
|
|
|
class cmCTestGIT : public cmCTestGlobalVC
|
2009-10-04 10:30:41 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Construct with a CTest instance and update log stream. */
|
|
|
|
cmCTestGIT(cmCTest* ctest, std::ostream& log);
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
~cmCTestGIT() override;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
|
|
|
private:
|
2011-06-19 15:41:06 +03:00
|
|
|
unsigned int CurrentGitVersion;
|
|
|
|
unsigned int GetGitVersion();
|
2009-10-04 10:30:41 +03:00
|
|
|
std::string GetWorkingRevision();
|
2018-01-26 17:06:56 +01:00
|
|
|
bool NoteOldRevision() override;
|
|
|
|
bool NoteNewRevision() override;
|
|
|
|
bool UpdateImpl() override;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2010-11-13 01:00:53 +02:00
|
|
|
std::string FindGitDir();
|
|
|
|
std::string FindTopDir();
|
|
|
|
|
2010-06-23 01:18:35 +03:00
|
|
|
bool UpdateByFetchAndReset();
|
|
|
|
bool UpdateByCustom(std::string const& custom);
|
|
|
|
bool UpdateInternal();
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
bool LoadRevisions() override;
|
|
|
|
bool LoadModifications() override;
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2016-07-09 11:21:54 +02:00
|
|
|
// "public" needed by older Sun compilers
|
|
|
|
public:
|
2009-10-04 10:30:41 +03:00
|
|
|
// Parsing helper classes.
|
|
|
|
class CommitParser;
|
2016-10-30 18:24:19 +01:00
|
|
|
class DiffParser;
|
|
|
|
class OneLineParser;
|
|
|
|
|
2009-10-04 10:30:41 +03:00
|
|
|
friend class CommitParser;
|
2016-10-30 18:24:19 +01:00
|
|
|
friend class DiffParser;
|
|
|
|
friend class OneLineParser;
|
2009-10-04 10:30:41 +03:00
|
|
|
};
|