MCPcopy Create free account
hub / github.com/Kitware/CMake / LoadRevisions

Method LoadRevisions

Source/CTest/cmCTestP4.cxx:385–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385bool cmCTestP4::LoadRevisions()
386{
387 std::vector<std::string> p4_changes;
388 this->SetP4Options(p4_changes);
389
390 // Use 'p4 changes ...@old,new' to get a list of changelists
391 std::string range = this->SourceDirectory + "/...";
392
393 // If any revision is unknown it means we couldn't contact the server.
394 // Do not process updates
395 if (this->OldRevision == "<unknown>" || this->NewRevision == "<unknown>") {
396 cmCTestLog(this->CTest, HANDLER_OUTPUT,
397 " At least one of the revisions "
398 << "is unknown. No repository changes will be reported.\n");
399 return false;
400 }
401
402 range.append("@")
403 .append(this->OldRevision)
404 .append(",")
405 .append(this->NewRevision);
406
407 p4_changes.emplace_back("changes");
408 p4_changes.push_back(range);
409
410 ChangesParser out(this, "p4_changes-out> ");
411 OutputLogger err(this->Log, "p4_changes-err> ");
412
413 this->ChangeLists.clear();
414 this->RunChild(p4_changes, &out, &err);
415
416 if (this->ChangeLists.empty()) {
417 return true;
418 }
419
420 // p4 describe -s ...@1111111,2222222
421 std::vector<std::string> p4_describe;
422 for (std::string const& i : cmReverseRange(this->ChangeLists)) {
423 this->SetP4Options(p4_describe);
424 p4_describe.emplace_back("describe");
425 p4_describe.emplace_back("-s");
426 p4_describe.push_back(i);
427
428 DescribeParser outDescribe(this, "p4_describe-out> ");
429 OutputLogger errDescribe(this->Log, "p4_describe-err> ");
430 this->RunChild(p4_describe, &outDescribe, &errDescribe);
431 }
432 return true;
433}
434
435bool cmCTestP4::LoadModifications()
436{

Callers

nothing calls this directly

Calls 8

SetP4OptionsMethod · 0.95
cmReverseRangeFunction · 0.85
appendMethod · 0.80
emplace_backMethod · 0.80
push_backMethod · 0.80
clearMethod · 0.45
RunChildMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected