Build a dictionary of changelists and labels, for "detect-labels" option.
(self)
| 3536 | % (labelDetails["label"], change)) |
| 3537 | |
| 3538 | def getLabels(self): |
| 3539 | """Build a dictionary of changelists and labels, for "detect-labels" |
| 3540 | option. |
| 3541 | """ |
| 3542 | |
| 3543 | self.labels = {} |
| 3544 | |
| 3545 | l = p4CmdList(["labels"] + ["%s..." % p for p in self.depotPaths]) |
| 3546 | if len(l) > 0 and not self.silent: |
| 3547 | print("Finding files belonging to labels in %s" % self.depotPaths) |
| 3548 | |
| 3549 | for output in l: |
| 3550 | label = output["label"] |
| 3551 | revisions = {} |
| 3552 | newestChange = 0 |
| 3553 | if self.verbose: |
| 3554 | print("Querying files for label %s" % label) |
| 3555 | for file in p4CmdList(["files"] + |
| 3556 | ["%s...@%s" % (p, label) |
| 3557 | for p in self.depotPaths]): |
| 3558 | revisions[file["depotFile"]] = file["rev"] |
| 3559 | change = int(file["change"]) |
| 3560 | if change > newestChange: |
| 3561 | newestChange = change |
| 3562 | |
| 3563 | self.labels[newestChange] = [output, revisions] |
| 3564 | |
| 3565 | if self.verbose: |
| 3566 | print("Label changes: %s" % self.labels.keys()) |
| 3567 | |
| 3568 | def importP4Labels(self, stream, p4Labels): |
| 3569 | """Import p4 labels as git tags. A direct mapping does not exist, so |