Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 if not match: | 98 if not match: |
| 99 self.Die("Could not extract current svn revision from log.") | 99 self.Die("Could not extract current svn revision from log.") |
| 100 self.Persist("latest", match.group(1)) | 100 self.Persist("latest", match.group(1)) |
| 101 | 101 |
| 102 | 102 |
| 103 class CheckLastPush(Step): | 103 class CheckLastPush(Step): |
| 104 MESSAGE = "Checking last V8 push to trunk." | 104 MESSAGE = "Checking last V8 push to trunk." |
| 105 | 105 |
| 106 def RunStep(self): | 106 def RunStep(self): |
| 107 self.RestoreIfUnset("latest") | 107 self.RestoreIfUnset("latest") |
| 108 log = self.Git("svn log -1 --oneline ChangeLog").strip() | 108 push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based" |
|
Jakob Kummerow
2014/02/19 12:44:49
Same s/*/+/ comment here... this looks like a cand
Michael Achenbach
2014/02/19 13:24:02
Extract method: Done. Regarding +: see the other c
| |
| 109 match = re.match(r"^r(\d+) \| Prepare push to trunk", log) | 109 args = "log -1 --format=%%H --grep=\"%s\" svn/trunk" % push_pattern |
| 110 if match: | 110 last_push_hash = self.Git(args).strip() |
| 111 latest = int(self._state["latest"]) | 111 last_push = int(self.Git("svn find-rev %s" % last_push_hash).strip()) |
| 112 last_push = int(match.group(1)) | 112 |
| 113 # TODO(machebach): This metric counts all revisions. It could be | 113 # TODO(machebach): This metric counts all revisions. It could be |
|
Jakob Kummerow
2014/02/19 12:44:49
Who's machebach?
Michael Achenbach
2014/02/19 13:23:03
Done.
| |
| 114 # improved by counting only the revisions on bleeding_edge. | 114 # improved by counting only the revisions on bleeding_edge. |
| 115 if latest - last_push < 10: | 115 if int(self._state["latest"]) - last_push < 10: |
| 116 # This makes sure the script doesn't push twice in a row when the cron | 116 # This makes sure the script doesn't push twice in a row when the cron |
| 117 # job retries several times. | 117 # job retries several times. |
| 118 self.Die("Last push too recently: %d" % last_push) | 118 self.Die("Last push too recently: %d" % last_push) |
| 119 | 119 |
| 120 | 120 |
| 121 class FetchLKGR(Step): | 121 class FetchLKGR(Step): |
| 122 MESSAGE = "Fetching V8 LKGR." | 122 MESSAGE = "Fetching V8 LKGR." |
| 123 | 123 |
| 124 def RunStep(self): | 124 def RunStep(self): |
| 125 lkgr_url = "https://v8-status.appspot.com/lkgr" | 125 lkgr_url = "https://v8-status.appspot.com/lkgr" |
| 126 # Retry several times since app engine might have issues. | 126 # Retry several times since app engine might have issues. |
| 127 self.Persist("lkgr", self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300])) | 127 self.Persist("lkgr", self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300])) |
| 128 | 128 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 parser = BuildOptions() | 210 parser = BuildOptions() |
| 211 (options, args) = parser.parse_args() | 211 (options, args) = parser.parse_args() |
| 212 if not options.a or not options.c or not options.reviewer: | 212 if not options.a or not options.c or not options.reviewer: |
| 213 print "You need to specify author, chromium src location and reviewer." | 213 print "You need to specify author, chromium src location and reviewer." |
| 214 parser.print_help() | 214 parser.print_help() |
| 215 return 1 | 215 return 1 |
| 216 RunAutoRoll(CONFIG, AutoRollOptions(options)) | 216 RunAutoRoll(CONFIG, AutoRollOptions(options)) |
| 217 | 217 |
| 218 if __name__ == "__main__": | 218 if __name__ == "__main__": |
| 219 sys.exit(Main()) | 219 sys.exit(Main()) |
| OLD | NEW |