| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if not match: | 55 if not match: |
| 56 self.Die("Could not extract current svn revision from log.") | 56 self.Die("Could not extract current svn revision from log.") |
| 57 self.Persist("latest", match.group(1)) | 57 self.Persist("latest", match.group(1)) |
| 58 | 58 |
| 59 | 59 |
| 60 class FetchLKGR(Step): | 60 class FetchLKGR(Step): |
| 61 MESSAGE = "Fetching V8 LKGR." | 61 MESSAGE = "Fetching V8 LKGR." |
| 62 | 62 |
| 63 def RunStep(self): | 63 def RunStep(self): |
| 64 lkgr_url = "https://v8-status.appspot.com/lkgr" | 64 lkgr_url = "https://v8-status.appspot.com/lkgr" |
| 65 self.Persist("lkgr", self.ReadURL(lkgr_url)) | 65 # Retry several times since app engine might have issues. |
| 66 self.Persist("lkgr", self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300])) |
| 66 | 67 |
| 67 | 68 |
| 68 class PushToTrunk(Step): | 69 class PushToTrunk(Step): |
| 69 MESSAGE = "Pushing to trunk if possible." | 70 MESSAGE = "Pushing to trunk if possible." |
| 70 | 71 |
| 71 def RunStep(self): | 72 def RunStep(self): |
| 72 self.RestoreIfUnset("latest") | 73 self.RestoreIfUnset("latest") |
| 73 self.RestoreIfUnset("lkgr") | 74 self.RestoreIfUnset("lkgr") |
| 74 latest = int(self._state["latest"]) | 75 latest = int(self._state["latest"]) |
| 75 lkgr = int(self._state["lkgr"]) | 76 lkgr = int(self._state["lkgr"]) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 Preparation, | 89 Preparation, |
| 89 FetchLatestRevision, | 90 FetchLatestRevision, |
| 90 FetchLKGR, | 91 FetchLKGR, |
| 91 PushToTrunk, | 92 PushToTrunk, |
| 92 ] | 93 ] |
| 93 RunScript(step_classes, config, options, side_effect_handler) | 94 RunScript(step_classes, config, options, side_effect_handler) |
| 94 | 95 |
| 95 | 96 |
| 96 def BuildOptions(): | 97 def BuildOptions(): |
| 97 result = optparse.OptionParser() | 98 result = optparse.OptionParser() |
| 99 result.add_option("-f", "--force", dest="f", |
| 100 help="Don't prompt the user.", |
| 101 default=True, action="store_true") |
| 98 result.add_option("-s", "--step", dest="s", | 102 result.add_option("-s", "--step", dest="s", |
| 99 help="Specify the step where to start work. Default: 0.", | 103 help="Specify the step where to start work. Default: 0.", |
| 100 default=0, type="int") | 104 default=0, type="int") |
| 101 return result | 105 return result |
| 102 | 106 |
| 103 | 107 |
| 104 def Main(): | 108 def Main(): |
| 105 parser = BuildOptions() | 109 parser = BuildOptions() |
| 106 (options, args) = parser.parse_args() | 110 (options, args) = parser.parse_args() |
| 107 RunAutoRoll(CONFIG, options) | 111 RunAutoRoll(CONFIG, options) |
| 108 | 112 |
| 109 if __name__ == "__main__": | 113 if __name__ == "__main__": |
| 110 sys.exit(Main()) | 114 sys.exit(Main()) |
| OLD | NEW |