| 383 | } |
| 384 | |
| 385 | bool 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 | |
| 435 | bool cmCTestP4::LoadModifications() |
| 436 | { |
nothing calls this directly
no test coverage detected