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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 match = re.match(r"^r(\d+) ", log) | 97 match = re.match(r"^r(\d+) ", log) |
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["latest"] = match.group(1) | 100 self["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 log = self.Git("svn log -1 --oneline ChangeLog").strip() | 107 last_push_hash = self.FindLastTrunkPush() |
108 match = re.match(r"^r(\d+) \| Prepare push to trunk", log) | 108 last_push = int(self.Git("svn find-rev %s" % last_push_hash).strip()) |
109 if match: | 109 |
110 latest = int(self["latest"]) | 110 # TODO(machenbach): This metric counts all revisions. It could be |
111 last_push = int(match.group(1)) | 111 # improved by counting only the revisions on bleeding_edge. |
112 # TODO(machebach): This metric counts all revisions. It could be | 112 if int(self["latest"]) - last_push < 10: |
113 # improved by counting only the revisions on bleeding_edge. | 113 # This makes sure the script doesn't push twice in a row when the cron |
114 if latest - last_push < 10: | 114 # job retries several times. |
115 # This makes sure the script doesn't push twice in a row when the cron | 115 self.Die("Last push too recently: %d" % last_push) |
116 # job retries several times. | |
117 self.Die("Last push too recently: %d" % last_push) | |
118 | 116 |
119 | 117 |
120 class FetchLKGR(Step): | 118 class FetchLKGR(Step): |
121 MESSAGE = "Fetching V8 LKGR." | 119 MESSAGE = "Fetching V8 LKGR." |
122 | 120 |
123 def RunStep(self): | 121 def RunStep(self): |
124 lkgr_url = "https://v8-status.appspot.com/lkgr" | 122 lkgr_url = "https://v8-status.appspot.com/lkgr" |
125 # Retry several times since app engine might have issues. | 123 # Retry several times since app engine might have issues. |
126 self["lkgr"] = self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300]) | 124 self["lkgr"] = self.ReadURL(lkgr_url, wait_plan=[5, 20, 300, 300]) |
127 | 125 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 parser = BuildOptions() | 204 parser = BuildOptions() |
207 (options, args) = parser.parse_args() | 205 (options, args) = parser.parse_args() |
208 if not options.a or not options.c or not options.reviewer: | 206 if not options.a or not options.c or not options.reviewer: |
209 print "You need to specify author, chromium src location and reviewer." | 207 print "You need to specify author, chromium src location and reviewer." |
210 parser.print_help() | 208 parser.print_help() |
211 return 1 | 209 return 1 |
212 RunAutoRoll(CONFIG, AutoRollOptions(options)) | 210 RunAutoRoll(CONFIG, AutoRollOptions(options)) |
213 | 211 |
214 if __name__ == "__main__": | 212 if __name__ == "__main__": |
215 sys.exit(Main()) | 213 sys.exit(Main()) |
OLD | NEW |