[Cmake-commits] CMake branch, next, updated. v2.8.1-1480-g62a0993

Brad King brad.king at kitware.com
Wed Jun 23 09:21:41 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  62a0993c3ff758aa509fd115ecef4fbbb1700d0d (commit)
       via  bbfe241c6a4386a39ebb93cdb70a8390eab14eef (commit)
      from  97c0dd3d52be1fb9b838406ffb3e05fa23d7f2c6 (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=62a0993c3ff758aa509fd115ecef4fbbb1700d0d
commit 62a0993c3ff758aa509fd115ecef4fbbb1700d0d
Merge: 97c0dd3 bbfe241
Author: Brad King <brad.king at kitware.com>
Date:   Wed Jun 23 09:20:22 2010 -0400

    Merge branch 'ctest-git-empty-commits' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbfe241c6a4386a39ebb93cdb70a8390eab14eef
commit bbfe241c6a4386a39ebb93cdb70a8390eab14eef
Author: Brad King <brad.king at kitware.com>
Date:   Wed Jun 23 09:14:43 2010 -0400

    CTest: Parse empty Git commits correctly
    
    Git's diff-tree format has no '\n'-terminated blank line at the end of
    its commit message body block if there are no diff lines.  Instead the
    message body is terminated by '\0' and there is no diff section.  Teach
    CTest to parse the format in this case.

diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 6c3631c..a49c852 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -317,8 +317,12 @@ protected:
    \n
        Log message indented by (4) spaces\n
        (even blank lines have the spaces)\n
+ [[
    \n
    [Diff format]
+ OR
+   \0
+ ]]
 
    The header may have more fields.  See 'git help diff-tree'.
 */
@@ -372,6 +376,11 @@ private:
     {
     if(this->Line.empty())
       {
+      if(this->Section == SectionBody && this->LineEnd == '\0')
+        {
+        // Skip SectionDiff
+        this->NextSection();
+        }
       this->NextSection();
       }
     else
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index cacd766..d2f7bf3 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -44,7 +44,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp,
 
 //----------------------------------------------------------------------------
 cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR):
-  Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0)
+  Separator(sep), IgnoreCR(ignoreCR), Log(0), Prefix(0), LineEnd('\0')
 {
 }
 
@@ -61,8 +61,10 @@ bool cmProcessTools::LineParser::ProcessChunk(const char* first, int length)
   const char* last = first + length;
   for(const char* c = first; c != last; ++c)
     {
-    if(*c == this->Separator)
+    if(*c == this->Separator || *c == '\0')
       {
+      this->LineEnd = *c;
+
       // Log this line.
       if(this->Log && this->Prefix)
         {
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index 0b210af..439726d 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -55,6 +55,7 @@ public:
     bool IgnoreCR;
     std::ostream* Log;
     const char* Prefix;
+    char LineEnd;
     std::string Line;
     virtual bool ProcessChunk(const char* data, int length);
 
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 4ac1b31..f672a52 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -131,6 +131,22 @@ run_child(
   COMMAND ${GIT} submodule update
   )
 
+# Save the first revision name.
+execute_process(
+  WORKING_DIRECTORY ${TOP}/user-source
+  COMMAND ${GIT} rev-parse HEAD
+  OUTPUT_VARIABLE revision1
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+
+#-----------------------------------------------------------------------------
+# Create an empty commit.
+message("Creating empty commit...")
+run_child(
+  WORKING_DIRECTORY ${TOP}/user-source
+  COMMAND ${GIT} commit --allow-empty -m "Empty commit"
+  )
+
 #-----------------------------------------------------------------------------
 # Make changes in the working tree.
 message("Changing content...")
@@ -196,7 +212,7 @@ macro(rewind_source src_dir)
   message("Backing up to revision 1...")
   run_child(
     WORKING_DIRECTORY ${TOP}/${src_dir}
-    COMMAND ${GIT} reset --hard origin/master~2
+    COMMAND ${GIT} reset --hard ${revision1}
     )
   run_child(
     WORKING_DIRECTORY ${TOP}/${src_dir}
@@ -261,7 +277,7 @@ execute_process(
   )
 execute_process(
   WORKING_DIRECTORY \"${TOP}/dash-source\"
-  COMMAND \"${GIT}\" reset --hard master~2
+  COMMAND \"${GIT}\" reset --hard ${revision1}
   )
 execute_process(
   WORKING_DIRECTORY \"${TOP}/dash-source\"

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

Summary of changes:
 Source/CTest/cmCTestGIT.cxx   |    9 +++++++++
 Source/cmProcessTools.cxx     |    6 ++++--
 Source/cmProcessTools.h       |    1 +
 Tests/CTestUpdateGIT.cmake.in |   20 ++++++++++++++++++--
 4 files changed, 32 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list