MCPcopy Create free account
hub / github.com/git/git / p4_describe

Function p4_describe

git-p4.py:583–611  ·  view source on GitHub ↗

Make sure it returns a valid result by checking for the presence of field "time". Return a dict of the results.

(change, shelved=False)

Source from the content-addressed store, hash-verified

581
582
583def 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
614def split_p4_type(p4type):

Callers 4

importChangesMethod · 0.85
importHeadRevisionMethod · 0.85
createShelveParentMethod · 0.85
runMethod · 0.85

Calls 2

p4CmdListFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected