[Cmake-commits] CMake branch, next, updated. v2.8.12.1-7214-gd90b791

Brad King brad.king at kitware.com
Wed Jan 22 08:35:58 EST 2014


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  d90b7918159ff2878df73aade35ee5d4710508ea (commit)
       via  243cfc2f6f467c71e6dc5af0b1fb28980a31a5ae (commit)
      from  17eae5e869d5aa2c2180b1736273d2ca1f062075 (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=d90b7918159ff2878df73aade35ee5d4710508ea
commit d90b7918159ff2878df73aade35ee5d4710508ea
Merge: 17eae5e 243cfc2
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 22 08:35:57 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 22 08:35:57 2014 -0500

    Merge topic 'ctest-update-p4-unknown-revision' into next
    
    243cfc2f ctest_update: Handle P4 unknown revisions more robustly


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=243cfc2f6f467c71e6dc5af0b1fb28980a31a5ae
commit 243cfc2f6f467c71e6dc5af0b1fb28980a31a5ae
Author:     Pedro Navarro <pnavarro at netflix.com>
AuthorDate: Tue Jan 21 17:02:25 2014 -0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 22 08:33:33 2014 -0500

    ctest_update: Handle P4 unknown revisions more robustly
    
    Mark unknown revisions as such and fail instead of reporting revision 0.
    Otherwise CTest reports massive file updates between revisions when the
    server timeouts while trying to fetch the current revision number.

diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 0058721..b09d6f5 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -380,10 +380,16 @@ std::string cmCTestP4::GetWorkingRevision()
   p4_identify.push_back(0);
 
   std::string rev;
-  IdentifyParser out(this, "rev-out> ", rev);
-  OutputLogger err(this->Log, "rev-err> ");
+  IdentifyParser out(this, "p4_changes-out> ", rev);
+  OutputLogger err(this->Log, "p4_changes-err> ");
 
-  RunChild(&p4_identify[0], &out, &err);
+  bool result = RunChild(&p4_identify[0], &out, &err);
+
+  // If there was a problem contacting the server return "<unknown>"
+  if(!result)
+    {
+    return "<unknown>";
+    }
 
   if(rev.empty())
     {
@@ -423,29 +429,24 @@ void cmCTestP4::LoadRevisions()
   // Use 'p4 changes ... at old,new' to get a list of changelists
   std::string range = this->SourceDirectory + "/...";
 
-  if(this->OldRevision != "0")
+  // If any revision is unknown it means we couldn't contact the server.
+  // Do not process updates
+  if(this->OldRevision == "<unknown>" || this->NewRevision == "<unknown>")
     {
-    range.append("@").append(this->OldRevision);
+    cmCTestLog(this->CTest, HANDLER_OUTPUT, "   At least one of the revisions "
+               << "is unknown. No repository changes will be reported.\n");
+    return;
     }
 
-  if(this->NewRevision != "0")
-    {
-    if(this->OldRevision != "0")
-      {
-      range.append(",").append(this->NewRevision);
-      }
-    else
-      {
-      range.append("@").append(this->NewRevision);
-      }
-    }
+  range.append("@").append(this->OldRevision)
+       .append(",").append(this->NewRevision);
 
   p4_changes.push_back("changes");
   p4_changes.push_back(range.c_str());
   p4_changes.push_back(0);
 
-  ChangesParser out(this, "changes-out> ");
-  OutputLogger err(this->Log, "changes-err> ");
+  ChangesParser out(this, "p4_changes-out> ");
+  OutputLogger err(this->Log, "p4_changes-err> ");
 
   ChangeLists.clear();
   this->RunChild(&p4_changes[0], &out, &err);
@@ -464,8 +465,8 @@ void cmCTestP4::LoadRevisions()
     p4_describe.push_back(i->c_str());
     p4_describe.push_back(0);
 
-    DescribeParser outDescribe(this, "describe-out> ");
-    OutputLogger errDescribe(this->Log, "describe-err> ");
+    DescribeParser outDescribe(this, "p4_describe-out> ");
+    OutputLogger errDescribe(this->Log, "p4_describe-err> ");
     this->RunChild(&p4_describe[0], &outDescribe, &errDescribe);
     }
 }
@@ -484,8 +485,8 @@ void cmCTestP4::LoadModifications()
   p4_diff.push_back(source.c_str());
   p4_diff.push_back(0);
 
-  DiffParser out(this, "diff-out> ");
-  OutputLogger err(this->Log, "diff-err> ");
+  DiffParser out(this, "p4_diff-out> ");
+  OutputLogger err(this->Log, "p4_diff-err> ");
   this->RunChild(&p4_diff[0], &out, &err);
 }
 
@@ -503,8 +504,8 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
     }
   p4_custom.push_back(0);
 
-  OutputLogger custom_out(this->Log, "custom-out> ");
-  OutputLogger custom_err(this->Log, "custom-err> ");
+  OutputLogger custom_out(this->Log, "p4_customsync-out> ");
+  OutputLogger custom_err(this->Log, "p4_customsync-err> ");
 
   return this->RunUpdateCommand(&p4_custom[0], &custom_out, &custom_err);
 }
@@ -518,6 +519,14 @@ bool cmCTestP4::UpdateImpl()
     return this->UpdateCustom(custom);
     }
 
+  // If we couldn't get a revision number before updating, abort.
+  if(this->OldRevision == "<unknown>")
+    {
+    this->UpdateCommandLine = "Unknown current revision";
+    cmCTestLog(this->CTest, ERROR_MESSAGE, "   Unknown current revision\n");
+    return false;
+    }
+
   std::vector<char const*> p4_sync;
   SetP4Options(p4_sync);
 
@@ -552,8 +561,8 @@ bool cmCTestP4::UpdateImpl()
   p4_sync.push_back(source.c_str());
   p4_sync.push_back(0);
 
-  OutputLogger out(this->Log, "sync-out> ");
-  OutputLogger err(this->Log, "sync-err> ");
+  OutputLogger out(this->Log, "p4_sync-out> ");
+  OutputLogger err(this->Log, "p4_sync-err> ");
 
   return this->RunUpdateCommand(&p4_sync[0], &out, &err);
 }
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index db4e08d..642a618 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -54,7 +54,9 @@ function(check_updates build)
   set(EXTRA "${UPDATE_XML_ENTRIES}")
   list(REMOVE_ITEM EXTRA ${ARGN} ${UPDATE_EXTRA} ${UPDATE_MAYBE})
   set(MISSING "${ARGN}" ${UPDATE_EXTRA})
-  list(REMOVE_ITEM MISSING ${UPDATE_XML_ENTRIES})
+  if(NOT "" STREQUAL "${UPDATE_XML_ENTRIES}")
+    list(REMOVE_ITEM MISSING ${UPDATE_XML_ENTRIES})
+  endif()
 
   if(NOT UPDATE_NOT_GLOBAL)
     set(rev_elements Revision PriorRevision ${UPDATE_GLOBAL_ELEMENTS})

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

Summary of changes:
 Source/CTest/cmCTestP4.cxx    |   61 +++++++++++++++++++++++------------------
 Tests/CTestUpdateCommon.cmake |    4 ++-
 2 files changed, 38 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list