| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 def RunStep(self): | 249 def RunStep(self): |
| 250 self.WaitForLGTM() | 250 self.WaitForLGTM() |
| 251 # Re-read the ChangeLog entry (to pick up possible changes). | 251 # Re-read the ChangeLog entry (to pick up possible changes). |
| 252 # FIXME(machenbach): This was hanging once with a broken pipe. | 252 # FIXME(machenbach): This was hanging once with a broken pipe. |
| 253 TextToFile(GetLastChangeLogEntries(self.Config(CHANGELOG_FILE)), | 253 TextToFile(GetLastChangeLogEntries(self.Config(CHANGELOG_FILE)), |
| 254 self.Config(CHANGELOG_ENTRY_FILE)) | 254 self.Config(CHANGELOG_ENTRY_FILE)) |
| 255 | 255 |
| 256 if self.Git("cl presubmit", "PRESUBMIT_TREE_CHECK=\"skip\"") is None: | 256 if self.Git("cl presubmit", "PRESUBMIT_TREE_CHECK=\"skip\"") is None: |
| 257 self.Die("'git cl presubmit' failed, please try again.") | 257 self.Die("'git cl presubmit' failed, please try again.") |
| 258 | 258 |
| 259 if self.Git("cl dcommit -f --bypass-hooks") is None: | 259 if self.Git("cl dcommit -f --bypass-hooks", |
| 260 retry_on=lambda x: x is None) is None: |
| 260 self.Die("'git cl dcommit' failed, please try again.") | 261 self.Die("'git cl dcommit' failed, please try again.") |
| 261 | 262 |
| 262 | 263 |
| 263 class StragglerCommits(Step): | 264 class StragglerCommits(Step): |
| 264 MESSAGE = ("Fetch straggler commits that sneaked in since this script was " | 265 MESSAGE = ("Fetch straggler commits that sneaked in since this script was " |
| 265 "started.") | 266 "started.") |
| 266 | 267 |
| 267 def RunStep(self): | 268 def RunStep(self): |
| 268 if self.Git("svn fetch") is None: | 269 if self.Git("svn fetch") is None: |
| 269 self.Die("'git svn fetch' failed.") | 270 self.Die("'git svn fetch' failed.") |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if not self.Confirm("Please check if your local checkout is sane: Inspect " | 360 if not self.Confirm("Please check if your local checkout is sane: Inspect " |
| 360 "%s, compile, run tests. Do you want to commit this new trunk " | 361 "%s, compile, run tests. Do you want to commit this new trunk " |
| 361 "revision to the repository?" % self.Config(VERSION_FILE)): | 362 "revision to the repository?" % self.Config(VERSION_FILE)): |
| 362 self.Die("Execution canceled.") | 363 self.Die("Execution canceled.") |
| 363 | 364 |
| 364 | 365 |
| 365 class CommitSVN(Step): | 366 class CommitSVN(Step): |
| 366 MESSAGE = "Commit to SVN." | 367 MESSAGE = "Commit to SVN." |
| 367 | 368 |
| 368 def RunStep(self): | 369 def RunStep(self): |
| 369 result = self.Git("svn dcommit 2>&1") | 370 result = self.Git("svn dcommit 2>&1", retry_on=lambda x: x is None) |
| 370 if not result: | 371 if not result: |
| 371 self.Die("'git svn dcommit' failed.") | 372 self.Die("'git svn dcommit' failed.") |
| 372 result = filter(lambda x: re.search(r"^Committed r[0-9]+", x), | 373 result = filter(lambda x: re.search(r"^Committed r[0-9]+", x), |
| 373 result.splitlines()) | 374 result.splitlines()) |
| 374 if len(result) > 0: | 375 if len(result) > 0: |
| 375 trunk_revision = re.sub(r"^Committed r([0-9]+)", r"\1", result[0]) | 376 trunk_revision = re.sub(r"^Committed r([0-9]+)", r"\1", result[0]) |
| 376 | 377 |
| 377 # Sometimes grepping for the revision fails. No idea why. If you figure | 378 # Sometimes grepping for the revision fails. No idea why. If you figure |
| 378 # out why it is flaky, please do fix it properly. | 379 # out why it is flaky, please do fix it properly. |
| 379 if not trunk_revision: | 380 if not trunk_revision: |
| 380 print("Sorry, grepping for the SVN revision failed. Please look for it " | 381 print("Sorry, grepping for the SVN revision failed. Please look for it " |
| 381 "in the last command's output above and provide it manually (just " | 382 "in the last command's output above and provide it manually (just " |
| 382 "the number, without the leading \"r\").") | 383 "the number, without the leading \"r\").") |
| 383 self.DieNoManualMode("Can't prompt in forced mode.") | 384 self.DieNoManualMode("Can't prompt in forced mode.") |
| 384 while not trunk_revision: | 385 while not trunk_revision: |
| 385 print "> ", | 386 print "> ", |
| 386 trunk_revision = self.ReadLine() | 387 trunk_revision = self.ReadLine() |
| 387 self.Persist("trunk_revision", trunk_revision) | 388 self.Persist("trunk_revision", trunk_revision) |
| 388 | 389 |
| 389 | 390 |
| 390 class TagRevision(Step): | 391 class TagRevision(Step): |
| 391 MESSAGE = "Tag the new revision." | 392 MESSAGE = "Tag the new revision." |
| 392 | 393 |
| 393 def RunStep(self): | 394 def RunStep(self): |
| 394 self.RestoreVersionIfUnset() | 395 self.RestoreVersionIfUnset() |
| 395 ver = "%s.%s.%s" % (self._state["major"], | 396 ver = "%s.%s.%s" % (self._state["major"], |
| 396 self._state["minor"], | 397 self._state["minor"], |
| 397 self._state["build"]) | 398 self._state["build"]) |
| 398 if self.Git("svn tag %s -m \"Tagging version %s\"" % (ver, ver)) is None: | 399 if self.Git("svn tag %s -m \"Tagging version %s\"" % (ver, ver), |
| 400 retry_on=lambda x: x is None) is None: |
| 399 self.Die("'git svn tag' failed.") | 401 self.Die("'git svn tag' failed.") |
| 400 | 402 |
| 401 | 403 |
| 402 class CheckChromium(Step): | 404 class CheckChromium(Step): |
| 403 MESSAGE = "Ask for chromium checkout." | 405 MESSAGE = "Ask for chromium checkout." |
| 404 | 406 |
| 405 def Run(self): | 407 def Run(self): |
| 406 chrome_path = self._options.c | 408 chrome_path = self._options.c |
| 407 if not chrome_path: | 409 if not chrome_path: |
| 408 self.DieNoManualMode("Please specify the path to a Chromium checkout in " | 410 self.DieNoManualMode("Please specify the path to a Chromium checkout in " |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 def Main(): | 595 def Main(): |
| 594 parser = BuildOptions() | 596 parser = BuildOptions() |
| 595 (options, args) = parser.parse_args() | 597 (options, args) = parser.parse_args() |
| 596 if not ProcessOptions(options): | 598 if not ProcessOptions(options): |
| 597 parser.print_help() | 599 parser.print_help() |
| 598 return 1 | 600 return 1 |
| 599 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) | 601 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) |
| 600 | 602 |
| 601 if __name__ == "__main__": | 603 if __name__ == "__main__": |
| 602 sys.exit(Main()) | 604 sys.exit(Main()) |
| OLD | NEW |