cmCTestSVN: Add the new SVNInfo structure
It represents information of an SVN repository. It can be the base repository or an external one.
This commit is contained in:
parent
19d9f5908b
commit
aa1076f460
|
@ -448,3 +448,29 @@ void cmCTestSVN::WriteXMLGlobal(std::ostream& xml)
|
||||||
|
|
||||||
xml << "\t<SVNPath>" << this->Base << "</SVNPath>\n";
|
xml << "\t<SVNPath>" << this->Base << "</SVNPath>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string cmCTestSVN::SVNInfo::BuildLocalPath(std::string const& path) const
|
||||||
|
{
|
||||||
|
std::string local_path;
|
||||||
|
|
||||||
|
// Add local path prefix if not empty
|
||||||
|
if (!this->LocalPath.empty())
|
||||||
|
{
|
||||||
|
local_path += this->LocalPath;
|
||||||
|
local_path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add path with base prefix removed
|
||||||
|
if(path.size() > this->Base.size() &&
|
||||||
|
strncmp(path.c_str(), this->Base.c_str(), this->Base.size()) == 0)
|
||||||
|
{
|
||||||
|
local_path += (path.c_str() + this->Base.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
local_path += path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return local_path;
|
||||||
|
}
|
||||||
|
|
|
@ -42,6 +42,31 @@ private:
|
||||||
// Directory under repository root checked out in working tree.
|
// Directory under repository root checked out in working tree.
|
||||||
std::string Base;
|
std::string Base;
|
||||||
|
|
||||||
|
// Information about an SVN repository (root repository or external)
|
||||||
|
struct SVNInfo {
|
||||||
|
|
||||||
|
SVNInfo(const char* path) : LocalPath(path) {}
|
||||||
|
// Remove base from the filename
|
||||||
|
std::string BuildLocalPath(std::string const& path) const;
|
||||||
|
|
||||||
|
// LocalPath relative to the main source directory.
|
||||||
|
std::string LocalPath;
|
||||||
|
|
||||||
|
// URL of repository directory checked out in the working tree.
|
||||||
|
std::string URL;
|
||||||
|
|
||||||
|
// URL of repository root directory.
|
||||||
|
std::string Root;
|
||||||
|
|
||||||
|
// Directory under repository root checked out in working tree.
|
||||||
|
std::string Base;
|
||||||
|
|
||||||
|
// Old and new repository revisions.
|
||||||
|
std::string OldRevision;
|
||||||
|
std::string NewRevision;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
std::string LoadInfo();
|
std::string LoadInfo();
|
||||||
void LoadModifications();
|
void LoadModifications();
|
||||||
void LoadRevisions();
|
void LoadRevisions();
|
||||||
|
|
Loading…
Reference in New Issue