(self)
| 104 | return description |
| 105 | |
| 106 | def RunStep(self): |
| 107 | |
| 108 | # Stringify: ["abcde", "12345"] -> "abcde, 12345" |
| 109 | self["revision_list"] = ", ".join(self["full_revision_list"]) |
| 110 | |
| 111 | if not self["revision_list"]: # pragma: no cover |
| 112 | self.Die("Revision list is empty.") |
| 113 | |
| 114 | msg_pieces = [] |
| 115 | |
| 116 | if len(self["full_revision_list"]) > 1: |
| 117 | self["commit_title"] = "Merged: Squashed multiple commits." |
| 118 | for commit_hash in self["full_revision_list"]: |
| 119 | msg_pieces.append(self._create_commit_description(commit_hash)) |
| 120 | else: |
| 121 | commit_hash = self["full_revision_list"][0] |
| 122 | full_description = self._create_commit_description(commit_hash).split("\n") |
| 123 | |
| 124 | #Truncate title because of code review tool |
| 125 | title = full_description[0] |
| 126 | if len(title) > 100: |
| 127 | title = title[:96] + " ..." |
| 128 | |
| 129 | self["commit_title"] = title |
| 130 | msg_pieces.append(full_description[1] + "\n\n") |
| 131 | |
| 132 | bugs = [] |
| 133 | for commit_hash in self["full_revision_list"]: |
| 134 | msg = self.GitLog(n=1, git_hash=commit_hash) |
| 135 | for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, re.M): |
| 136 | bugs.extend(s.strip() for s in bug.split(",")) |
| 137 | gerrit_bug = GetCommitMessageFooterMap(msg).get('Bug', '') |
| 138 | bugs.extend(s.strip() for s in gerrit_bug.split(",")) |
| 139 | bug_aggregate = ",".join( |
| 140 | sorted(filter(lambda s: s and s != "none", set(bugs)))) |
| 141 | if bug_aggregate: |
| 142 | # TODO(machenbach): Use proper gerrit footer for bug after switch to |
| 143 | # gerrit. Keep BUG= for now for backwards-compatibility. |
| 144 | msg_pieces.append("BUG=%s\n" % bug_aggregate) |
| 145 | |
| 146 | self["new_commit_msg"] = "".join(msg_pieces) |
| 147 | |
| 148 | |
| 149 | class ApplyPatches(Step): |
nothing calls this directly
no test coverage detected