summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSVN.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2016-09-12 16:29:08 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2016-09-12 17:40:13 (GMT)
commitb35311ca44b7e8b40cc48aaac6cefbe8ca4ddba8 (patch)
treea07aec1e48d8be9f4ca323a8c4ee418f2c05c3c7 /Source/CTest/cmCTestSVN.cxx
parenta7305ef00a70518f7abb66211ef09b0ca6d4af71 (diff)
downloadCMake-b35311ca44b7e8b40cc48aaac6cefbe8ca4ddba8.zip
CMake-b35311ca44b7e8b40cc48aaac6cefbe8ca4ddba8.tar.gz
CMake-b35311ca44b7e8b40cc48aaac6cefbe8ca4ddba8.tar.bz2
CTestSVN: Fix segfault when CTEST_UPDATE_VERSION_ONLY is enabled
Before the change the list of externals was queried only before the svn update. With the change the list is queried both before and after. This should also be more accurate since the list of externals might change during the update.
Diffstat (limited to 'Source/CTest/cmCTestSVN.cxx')
-rw-r--r--Source/CTest/cmCTestSVN.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index f680612..0832820 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -108,13 +108,8 @@ std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
void cmCTestSVN::NoteOldRevision()
{
- // Info for root repository
- this->Repositories.push_back(SVNInfo(""));
- this->RootInfo = &(this->Repositories.back());
- // Info for the external repositories
- this->LoadExternals();
+ this->LoadRepositories();
- // Get info for all the repositories
std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
std::list<SVNInfo>::iterator itend = this->Repositories.end();
for (; itbeg != itend; itbeg++) {
@@ -134,7 +129,8 @@ void cmCTestSVN::NoteOldRevision()
void cmCTestSVN::NoteNewRevision()
{
- // Get info for the external repositories
+ this->LoadRepositories();
+
std::list<SVNInfo>::iterator itbeg = this->Repositories.begin();
std::list<SVNInfo>::iterator itend = this->Repositories.end();
for (; itbeg != itend; itbeg++) {
@@ -534,8 +530,13 @@ private:
}
};
-void cmCTestSVN::LoadExternals()
+void cmCTestSVN::LoadRepositories()
{
+ // Info for root repository
+ this->Repositories.clear();
+ this->Repositories.push_back(SVNInfo(""));
+ this->RootInfo = &(this->Repositories.back());
+
// Run "svn status" to get the list of external repositories
std::vector<const char*> svn_status;
svn_status.push_back("status");