diff options
author | Xavier Besseron <xavier.besseron@uni.lu> | 2012-09-03 08:45:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-03 14:38:51 (GMT) |
commit | aa1076f4600a94494da355d641aa0a5773a67863 (patch) | |
tree | 29663c4cce1e7010e39eba3f82a5ea3f85e2fcb0 /Source/CTest/cmCTestSVN.cxx | |
parent | 19d9f5908b541a3d61361cbfd1a315ac3f512543 (diff) | |
download | CMake-aa1076f4600a94494da355d641aa0a5773a67863.zip CMake-aa1076f4600a94494da355d641aa0a5773a67863.tar.gz CMake-aa1076f4600a94494da355d641aa0a5773a67863.tar.bz2 |
cmCTestSVN: Add the new SVNInfo structure
It represents information of an SVN repository. It can be the base
repository or an external one.
Diffstat (limited to 'Source/CTest/cmCTestSVN.cxx')
-rw-r--r-- | Source/CTest/cmCTestSVN.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx index fab9a8c..7ca87e2 100644 --- a/Source/CTest/cmCTestSVN.cxx +++ b/Source/CTest/cmCTestSVN.cxx @@ -448,3 +448,29 @@ void cmCTestSVN::WriteXMLGlobal(std::ostream& xml) 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; +} |