[Cmake-commits] CMake branch, next, updated. v2.8.2-274-g3f68c86
Brad King
brad.king at kitware.com
Tue Jul 27 11:33:43 EDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 3f68c86f7e4f0ea9dbb095baa4f9676e80a4ea5b (commit)
via a7319cf1c155a0e82c88689c0b4fe54b389a580e (commit)
from e682e668481b37cfcf22b348a99abf429f0c1b51 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f68c86f7e4f0ea9dbb095baa4f9676e80a4ea5b
commit 3f68c86f7e4f0ea9dbb095baa4f9676e80a4ea5b
Merge: e682e66 a7319cf
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 27 11:33:42 2010 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 27 11:33:42 2010 -0400
Merge topic 'ctest-git-flexibility' into next
a7319cf ctest_update: Run 'git submodule' at top level
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7319cf1c155a0e82c88689c0b4fe54b389a580e
commit a7319cf1c155a0e82c88689c0b4fe54b389a580e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 27 11:31:59 2010 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 27 11:31:59 2010 -0400
ctest_update: Run 'git submodule' at top level
The git submodule porcelain must be executed from the top level of the
work tree. Use 'git rev-parse --show-cdup' to find the top level
relative to the source tree. This is better than searching up the tree
for .git ourselves because it will always work the same way Git does and
thus honors settings like GIT_DISCOVERY_ACROSS_FILESYSTEM.
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index e44f81d..0fbc92e 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -133,6 +133,27 @@ std::string cmCTestGIT::FindGitDir()
}
//----------------------------------------------------------------------------
+std::string cmCTestGIT::FindTopDir()
+{
+ std::string top_dir = this->SourceDirectory;
+
+ // Run "git rev-parse --show-cdup" to locate the top of the tree.
+ const char* git = this->CommandLineTool.c_str();
+ char const* git_rev_parse[] = {git, "rev-parse", "--show-cdup", 0};
+ std::string cdup;
+ OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
+ OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
+ if(this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err) &&
+ !cdup.empty())
+ {
+ top_dir += "/";
+ top_dir += cdup;
+ top_dir = cmSystemTools::CollapseFullPath(top_dir.c_str());
+ }
+ return top_dir;
+}
+
+//----------------------------------------------------------------------------
bool cmCTestGIT::UpdateByFetchAndReset()
{
const char* git = this->CommandLineTool.c_str();
@@ -240,11 +261,13 @@ bool cmCTestGIT::UpdateImpl()
return false;
}
+ std::string top_dir = this->FindTopDir();
const char* git = this->CommandLineTool.c_str();
char const* git_submodule[] = {git, "submodule", "update", 0};
OutputLogger submodule_out(this->Log, "submodule-out> ");
OutputLogger submodule_err(this->Log, "submodule-err> ");
- return this->RunChild(git_submodule, &submodule_out, &submodule_err);
+ return this->RunChild(git_submodule, &submodule_out, &submodule_err,
+ top_dir.c_str());
}
//----------------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGIT.h b/Source/CTest/cmCTestGIT.h
index 760def0..1765340 100644
--- a/Source/CTest/cmCTestGIT.h
+++ b/Source/CTest/cmCTestGIT.h
@@ -33,6 +33,7 @@ private:
virtual bool UpdateImpl();
std::string FindGitDir();
+ std::string FindTopDir();
bool UpdateByFetchAndReset();
bool UpdateByCustom(std::string const& custom);
-----------------------------------------------------------------------
Summary of changes:
Source/CTest/cmCTestGIT.cxx | 25 ++++++++++++++++++++++++-
Source/CTest/cmCTestGIT.h | 1 +
2 files changed, 25 insertions(+), 1 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list