| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 for commit_hash in self["patch_commit_hashes"]: | 148 for commit_hash in self["patch_commit_hashes"]: |
| 149 patch_merge_desc = self.GitLog(n=1, format="%s", git_hash=commit_hash) | 149 patch_merge_desc = self.GitLog(n=1, format="%s", git_hash=commit_hash) |
| 150 self["new_commit_msg"] += "%s\n\n" % patch_merge_desc | 150 self["new_commit_msg"] += "%s\n\n" % patch_merge_desc |
| 151 | 151 |
| 152 bugs = [] | 152 bugs = [] |
| 153 for commit_hash in self["patch_commit_hashes"]: | 153 for commit_hash in self["patch_commit_hashes"]: |
| 154 msg = self.GitLog(n=1, git_hash=commit_hash) | 154 msg = self.GitLog(n=1, git_hash=commit_hash) |
| 155 for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, | 155 for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, |
| 156 re.M): | 156 re.M): |
| 157 bugs.extend(map(lambda s: s.strip(), bug.split(","))) | 157 bugs.extend(map(lambda s: s.strip(), bug.split(","))) |
| 158 bug_aggregate = ",".join(sorted(bugs)) | 158 bug_aggregate = ",".join(sorted(filter(lambda s: s and s != "none", bugs))) |
| 159 if bug_aggregate: | 159 if bug_aggregate: |
| 160 self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate | 160 self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate |
| 161 | 161 |
| 162 | 162 |
| 163 class ApplyPatches(Step): | 163 class ApplyPatches(Step): |
| 164 MESSAGE = "Apply patches for selected revisions." | 164 MESSAGE = "Apply patches for selected revisions." |
| 165 | 165 |
| 166 def RunStep(self): | 166 def RunStep(self): |
| 167 for commit_hash in self["patch_commit_hashes"]: | 167 for commit_hash in self["patch_commit_hashes"]: |
| 168 print("Applying patch for %s to %s..." | 168 print("Applying patch for %s to %s..." |
| (...skipping 156 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 |