| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 self.GitCheckout("svn/bleeding_edge") | 260 self.GitCheckout("svn/bleeding_edge") |
| 261 self["prepare_commit_hash"] = self.GitLog(n=1, format="%H", | 261 self["prepare_commit_hash"] = self.GitLog(n=1, format="%H", |
| 262 grep=self["prep_commit_msg"]) | 262 grep=self["prep_commit_msg"]) |
| 263 | 263 |
| 264 | 264 |
| 265 class SquashCommits(Step): | 265 class SquashCommits(Step): |
| 266 MESSAGE = "Squash commits into one." | 266 MESSAGE = "Squash commits into one." |
| 267 | 267 |
| 268 def RunStep(self): | 268 def RunStep(self): |
| 269 # Instead of relying on "git rebase -i", we'll just create a diff, because | 269 # Instead of relying on "git rebase -i", we'll just create a diff, because |
| 270 # that's easier to automate. | 270 # that's easier to automate. Exclude the ChangeLog file. It is not |
| 271 TextToFile(self.GitDiff("svn/trunk", self["prepare_commit_hash"]), | 271 # maintained on bleeding edge. Changes will be added in a separate step |
| 272 # below. |
| 273 TextToFile(self.GitDiff("svn/trunk", |
| 274 self["prepare_commit_hash"], |
| 275 exclude=[self.Config(CHANGELOG_FILE)]), |
| 272 self.Config(PATCH_FILE)) | 276 self.Config(PATCH_FILE)) |
| 273 | 277 |
| 274 # Convert the ChangeLog entry to commit message format. | 278 # Convert the ChangeLog entry to commit message format. |
| 275 text = FileToText(self.Config(CHANGELOG_ENTRY_FILE)) | 279 text = FileToText(self.Config(CHANGELOG_ENTRY_FILE)) |
| 276 | 280 |
| 277 # Remove date and trailing white space. | 281 # Remove date and trailing white space. |
| 278 text = re.sub(r"^%s: " % self["date"], "", text.rstrip()) | 282 text = re.sub(r"^%s: " % self["date"], "", text.rstrip()) |
| 279 | 283 |
| 280 # Retrieve svn revision for showing the used bleeding edge revision in the | 284 # Retrieve svn revision for showing the used bleeding edge revision in the |
| 281 # commit message. | 285 # commit message. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 304 | 308 |
| 305 | 309 |
| 306 class ApplyChanges(Step): | 310 class ApplyChanges(Step): |
| 307 MESSAGE = "Apply squashed changes." | 311 MESSAGE = "Apply squashed changes." |
| 308 | 312 |
| 309 def RunStep(self): | 313 def RunStep(self): |
| 310 self.ApplyPatch(self.Config(PATCH_FILE)) | 314 self.ApplyPatch(self.Config(PATCH_FILE)) |
| 311 Command("rm", "-f %s*" % self.Config(PATCH_FILE)) | 315 Command("rm", "-f %s*" % self.Config(PATCH_FILE)) |
| 312 | 316 |
| 313 | 317 |
| 318 class AddChangeLog(Step): |
| 319 MESSAGE = "Add ChangeLog changes to trunk branch." |
| 320 |
| 321 def RunStep(self): |
| 322 changelog_entry = FileToText(self.Config(NEW_CHANGELOG_FILE)) |
| 323 old_change_log = FileToText(self.Config(CHANGELOG_FILE)) |
| 324 new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log) |
| 325 TextToFile(new_change_log, self.Config(CHANGELOG_FILE)) |
| 326 os.remove(self.Config(NEW_CHANGELOG_FILE)) |
| 327 |
| 314 class SetVersion(Step): | 328 class SetVersion(Step): |
| 315 MESSAGE = "Set correct version for trunk." | 329 MESSAGE = "Set correct version for trunk." |
| 316 | 330 |
| 317 def RunStep(self): | 331 def RunStep(self): |
| 318 output = "" | 332 output = "" |
| 319 for line in FileToText(self.Config(VERSION_FILE)).splitlines(): | 333 for line in FileToText(self.Config(VERSION_FILE)).splitlines(): |
| 320 if line.startswith("#define MAJOR_VERSION"): | 334 if line.startswith("#define MAJOR_VERSION"): |
| 321 line = re.sub("\d+$", self["major"], line) | 335 line = re.sub("\d+$", self["major"], line) |
| 322 elif line.startswith("#define MINOR_VERSION"): | 336 elif line.startswith("#define MINOR_VERSION"): |
| 323 line = re.sub("\d+$", self["minor"], line) | 337 line = re.sub("\d+$", self["minor"], line) |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 PrepareChangeLog, | 536 PrepareChangeLog, |
| 523 EditChangeLog, | 537 EditChangeLog, |
| 524 IncrementVersion, | 538 IncrementVersion, |
| 525 CommitLocal, | 539 CommitLocal, |
| 526 UploadStep, | 540 UploadStep, |
| 527 CommitRepository, | 541 CommitRepository, |
| 528 StragglerCommits, | 542 StragglerCommits, |
| 529 SquashCommits, | 543 SquashCommits, |
| 530 NewBranch, | 544 NewBranch, |
| 531 ApplyChanges, | 545 ApplyChanges, |
| 546 AddChangeLog, |
| 532 SetVersion, | 547 SetVersion, |
| 533 CommitTrunk, | 548 CommitTrunk, |
| 534 SanityCheck, | 549 SanityCheck, |
| 535 CommitSVN, | 550 CommitSVN, |
| 536 TagRevision, | 551 TagRevision, |
| 537 CheckChromium, | 552 CheckChromium, |
| 538 SwitchChromium, | 553 SwitchChromium, |
| 539 UpdateChromiumCheckout, | 554 UpdateChromiumCheckout, |
| 540 UploadCL, | 555 UploadCL, |
| 541 SwitchV8, | 556 SwitchV8, |
| 542 CleanUp, | 557 CleanUp, |
| 543 ] | 558 ] |
| 544 | 559 |
| 545 | 560 |
| 546 if __name__ == "__main__": # pragma: no cover | 561 if __name__ == "__main__": # pragma: no cover |
| 547 sys.exit(PushToTrunk(CONFIG).Run()) | 562 sys.exit(PushToTrunk(CONFIG).Run()) |
| OLD | NEW |