[Cmake-commits] CMake branch, next, updated. v3.5.1-691-gaaf515c

Ben Boeckel ben.boeckel at kitware.com
Tue Mar 29 11:29:01 EDT 2016


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  aaf515c3532a68f33df3fc274b199c35d52205d1 (commit)
       via  1aa1a6a0e467b309ab3c93f11b99207cdf5d0924 (commit)
      from  641bc68e9a1e79d7df654f5768223238da9c820b (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aaf515c3532a68f33df3fc274b199c35d52205d1
commit aaf515c3532a68f33df3fc274b199c35d52205d1
Merge: 641bc68 1aa1a6a
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Mar 29 11:29:00 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 29 11:29:00 2016 -0400

    Merge topic 'ctest-run-submodule-sync' into next
    
    1aa1a6a0 cmCTestGIT: run git submodule {init,sync} to update


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1aa1a6a0e467b309ab3c93f11b99207cdf5d0924
commit 1aa1a6a0e467b309ab3c93f11b99207cdf5d0924
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Mar 29 11:05:15 2016 -0400
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Mar 29 11:27:27 2016 -0400

    cmCTestGIT: run git submodule {init,sync} to update
    
    Repositories which add submodules or change their URLs are not fixed by
    CTest when updating a git repository.

diff --git a/Help/release/dev/ctest-run-submodule-sync.rst b/Help/release/dev/ctest-run-submodule-sync.rst
new file mode 100644
index 0000000..55e87c0
--- /dev/null
+++ b/Help/release/dev/ctest-run-submodule-sync.rst
@@ -0,0 +1,6 @@
+ctest-run-submodule-sync
+------------------------
+
+* The :command:`ctest_update` command will now initialize and synchronize
+  submodules on an update. Updates which add submodules or change a
+  submodule's URL will now be pulled properly.
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index bbb3b9d..4dd617f 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -274,20 +274,39 @@ bool cmCTestGIT::UpdateImpl()
   const char* git = this->CommandLineTool.c_str();
   const char* recursive = "--recursive";
 
-  // Git < 1.6.5.0 did not support --recursive
-  if(this->GetGitVersion() < cmCTestGITVersion(1,6,5,0))
+  // Git < 1.8.1 did not support sync --recursive
+  if(this->GetGitVersion() < cmCTestGITVersion(1,8,1,0))
     {
     recursive = 0;
-    // No need to require >= 1.6.5.0 if there are no submodules.
+    // No need to require >= 1.8.1 if there are no submodules.
     if(cmSystemTools::FileExists((top_dir + "/.gitmodules").c_str()))
       {
-      this->Log << "Git < 1.6.5.0 cannot update submodules recursively\n";
+      this->Log << "Git < 1.8.1 cannot update submodules recursively\n";
       }
     }
 
-  char const* git_submodule[] = {git, "submodule", "update", recursive, 0};
   OutputLogger submodule_out(this->Log, "submodule-out> ");
   OutputLogger submodule_err(this->Log, "submodule-err> ");
+
+  char const* git_submodule_init[] = {git, "submodule", "init", 0};
+  bool ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
+                            top_dir.c_str());
+
+  if (!ret)
+    {
+    return false;
+    }
+
+  char const* git_submodule_sync[] = {git, "submodule", "sync", recursive, 0};
+  ret = this->RunChild(git_submodule_sync, &submodule_out, &submodule_err,
+                       top_dir.c_str());
+
+  if (!ret)
+    {
+    return false;
+    }
+
+  char const* git_submodule[] = {git, "submodule", "update", recursive, 0};
   return this->RunChild(git_submodule, &submodule_out, &submodule_err,
                         top_dir.c_str());
 }

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/ctest-run-submodule-sync.rst |    6 +++++
 Source/CTest/cmCTestGIT.cxx                   |   29 ++++++++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)
 create mode 100644 Help/release/dev/ctest-run-submodule-sync.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list