OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 for commit_hash in self["patch_commit_hashes"]: | 140 for commit_hash in self["patch_commit_hashes"]: |
141 patch_merge_desc = self.GitLog(n=1, format="%s", git_hash=commit_hash) | 141 patch_merge_desc = self.GitLog(n=1, format="%s", git_hash=commit_hash) |
142 self["new_commit_msg"] += "%s\n\n" % patch_merge_desc | 142 self["new_commit_msg"] += "%s\n\n" % patch_merge_desc |
143 | 143 |
144 bugs = [] | 144 bugs = [] |
145 for commit_hash in self["patch_commit_hashes"]: | 145 for commit_hash in self["patch_commit_hashes"]: |
146 msg = self.GitLog(n=1, git_hash=commit_hash) | 146 msg = self.GitLog(n=1, git_hash=commit_hash) |
147 for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, | 147 for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, |
148 re.M): | 148 re.M): |
149 bugs.extend(map(lambda s: s.strip(), bug.split(","))) | 149 bugs.extend(map(lambda s: s.strip(), bug.split(","))) |
150 bug_aggregate = ",".join(sorted(bugs)) | 150 bug_aggregate = ",".join(sorted(filter(lambda s: s and s != "none", bugs))) |
151 if bug_aggregate: | 151 if bug_aggregate: |
152 self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate | 152 self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate |
153 | 153 |
154 | 154 |
155 class ApplyPatches(Step): | 155 class ApplyPatches(Step): |
156 MESSAGE = "Apply patches for selected revisions." | 156 MESSAGE = "Apply patches for selected revisions." |
157 | 157 |
158 def RunStep(self): | 158 def RunStep(self): |
159 for commit_hash in self["patch_commit_hashes"]: | 159 for commit_hash in self["patch_commit_hashes"]: |
160 print("Applying patch for %s to %s..." | 160 print("Applying patch for %s to %s..." |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 UploadStep, | 325 UploadStep, |
326 CommitRepository, | 326 CommitRepository, |
327 PrepareSVN, | 327 PrepareSVN, |
328 TagRevision, | 328 TagRevision, |
329 CleanUp, | 329 CleanUp, |
330 ] | 330 ] |
331 | 331 |
332 | 332 |
333 if __name__ == "__main__": # pragma: no cover | 333 if __name__ == "__main__": # pragma: no cover |
334 sys.exit(MergeToBranch(CONFIG).Run()) | 334 sys.exit(MergeToBranch(CONFIG).Run()) |
OLD | NEW |