Make sure it returns a valid result by checking for the presence of field "time". Return a dict of the results.
(change, shelved=False)
| 581 | |
| 582 | |
| 583 | def p4_describe(change, shelved=False): |
| 584 | """Make sure it returns a valid result by checking for the presence of |
| 585 | field "time". |
| 586 | |
| 587 | Return a dict of the results. |
| 588 | """ |
| 589 | |
| 590 | cmd = ["describe", "-s"] |
| 591 | if shelved: |
| 592 | cmd += ["-S"] |
| 593 | cmd += [str(change)] |
| 594 | |
| 595 | ds = p4CmdList(cmd, skip_info=True) |
| 596 | if len(ds) != 1: |
| 597 | die("p4 describe -s %d did not return 1 result: %s" % (change, str(ds))) |
| 598 | |
| 599 | d = ds[0] |
| 600 | |
| 601 | if "p4ExitCode" in d: |
| 602 | die("p4 describe -s %d exited with %d: %s" % (change, d["p4ExitCode"], |
| 603 | str(d))) |
| 604 | if "code" in d: |
| 605 | if d["code"] == "error": |
| 606 | die("p4 describe -s %d returned error code: %s" % (change, str(d))) |
| 607 | |
| 608 | if "time" not in d: |
| 609 | die("p4 describe -s %d returned no \"time\": %s" % (change, str(d))) |
| 610 | |
| 611 | return d |
| 612 | |
| 613 | |
| 614 | def split_p4_type(p4type): |
no test coverage detected