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