| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 "%s, compile, run tests. Do you want to commit this new trunk " | 348 "%s, compile, run tests. Do you want to commit this new trunk " |
| 349 "revision to the repository?" % VERSION_FILE): | 349 "revision to the repository?" % VERSION_FILE): |
| 350 self.Die("Execution canceled.") # pragma: no cover | 350 self.Die("Execution canceled.") # pragma: no cover |
| 351 | 351 |
| 352 | 352 |
| 353 class CommitSVN(Step): | 353 class CommitSVN(Step): |
| 354 MESSAGE = "Commit to SVN." | 354 MESSAGE = "Commit to SVN." |
| 355 | 355 |
| 356 def RunStep(self): | 356 def RunStep(self): |
| 357 result = self.vc.Land() | 357 result = self.vc.Land() |
| 358 # TODO(machenbach): Remove/improve this logic before the git switch. | |
| 359 if not result: # pragma: no cover | |
| 360 self.Die("'git svn dcommit' failed.") | |
| 361 result = filter(lambda x: re.search(r"^Committed r[0-9]+", x), | |
| 362 result.splitlines()) | |
| 363 if len(result) > 0: | |
| 364 self["trunk_revision"] = re.sub(r"^Committed r([0-9]+)", r"\1",result[0]) | |
| 365 | |
| 366 # Sometimes grepping for the revision fails. No idea why. If you figure | |
| 367 # out why it is flaky, please do fix it properly. | |
| 368 if not self["trunk_revision"]: | |
| 369 print("Sorry, grepping for the SVN revision failed. Please look for it " | |
| 370 "in the last command's output above and provide it manually (just " | |
| 371 "the number, without the leading \"r\").") | |
| 372 self.DieNoManualMode("Can't prompt in forced mode.") | |
| 373 while not self["trunk_revision"]: | |
| 374 print "> ", | |
| 375 self["trunk_revision"] = self.ReadLine() | |
| 376 | 358 |
| 377 | 359 |
| 378 class TagRevision(Step): | 360 class TagRevision(Step): |
| 379 MESSAGE = "Tag the new revision." | 361 MESSAGE = "Tag the new revision." |
| 380 | 362 |
| 381 def RunStep(self): | 363 def RunStep(self): |
| 382 self.vc.Tag(self["version"]) | 364 self.vc.Tag(self["version"]) |
| 383 | 365 |
| 384 | 366 |
| 385 class CleanUp(Step): | 367 class CleanUp(Step): |
| 386 MESSAGE = "Done!" | 368 MESSAGE = "Done!" |
| 387 | 369 |
| 388 def RunStep(self): | 370 def RunStep(self): |
| 389 print("Congratulations, you have successfully created the trunk " | 371 print("Congratulations, you have successfully created the trunk " |
| 390 "revision %s. Please don't forget to roll this new version into " | 372 "revision %s." |
| 391 "Chromium, and to update the v8rel spreadsheet:" | |
| 392 % self["version"]) | 373 % self["version"]) |
| 393 print "%s\ttrunk\t%s" % (self["version"], self["trunk_revision"]) | |
| 394 | 374 |
| 395 self.CommonCleanup() | 375 self.CommonCleanup() |
| 396 if self.Config("TRUNKBRANCH") != self["current_branch"]: | 376 if self.Config("TRUNKBRANCH") != self["current_branch"]: |
| 397 self.GitDeleteBranch(self.Config("TRUNKBRANCH")) | 377 self.GitDeleteBranch(self.Config("TRUNKBRANCH")) |
| 398 | 378 |
| 399 | 379 |
| 400 class PushToTrunk(ScriptsBase): | 380 class PushToTrunk(ScriptsBase): |
| 401 def _PrepareOptions(self, parser): | 381 def _PrepareOptions(self, parser): |
| 402 group = parser.add_mutually_exclusive_group() | 382 group = parser.add_mutually_exclusive_group() |
| 403 group.add_argument("-f", "--force", | 383 group.add_argument("-f", "--force", |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 CommitTrunk, | 440 CommitTrunk, |
| 461 SanityCheck, | 441 SanityCheck, |
| 462 CommitSVN, | 442 CommitSVN, |
| 463 TagRevision, | 443 TagRevision, |
| 464 CleanUp, | 444 CleanUp, |
| 465 ] | 445 ] |
| 466 | 446 |
| 467 | 447 |
| 468 if __name__ == "__main__": # pragma: no cover | 448 if __name__ == "__main__": # pragma: no cover |
| 469 sys.exit(PushToTrunk().Run()) | 449 sys.exit(PushToTrunk().Run()) |
| OLD | NEW |