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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 def Reload(self, body): | 95 def Reload(self, body): |
96 """Attempts to reload the commit message from rietveld in order to allow | 96 """Attempts to reload the commit message from rietveld in order to allow |
97 late changes to the LOG flag. Note: This is brittle to future changes of | 97 late changes to the LOG flag. Note: This is brittle to future changes of |
98 the web page name or structure. | 98 the web page name or structure. |
99 """ | 99 """ |
100 match = re.search(r"^Review URL: https://codereview\.chromium\.org/(\d+)$", | 100 match = re.search(r"^Review URL: https://codereview\.chromium\.org/(\d+)$", |
101 body, flags=re.M) | 101 body, flags=re.M) |
102 if match: | 102 if match: |
103 cl_url = "https://codereview.chromium.org/%s/description" % match.group(1) | 103 cl_url = "https://codereview.chromium.org/%s/description" % match.group(1) |
104 try: | 104 try: |
105 body = self.ReadURL(cl_url) | 105 # Fetch from Rietveld but only retry once with one second delay since |
| 106 # there might be many revisions. |
| 107 body = self.ReadURL(cl_url, wait_plan=[1]) |
106 except urllib2.URLError: | 108 except urllib2.URLError: |
107 pass | 109 pass |
108 return body | 110 return body |
109 | 111 |
110 def RunStep(self): | 112 def RunStep(self): |
111 self.RestoreIfUnset("last_push") | 113 self.RestoreIfUnset("last_push") |
112 | 114 |
113 # These version numbers are used again later for the trunk commit. | 115 # These version numbers are used again later for the trunk commit. |
114 self.ReadAndPersistVersion() | 116 self.ReadAndPersistVersion() |
115 | 117 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 def Main(): | 572 def Main(): |
571 parser = BuildOptions() | 573 parser = BuildOptions() |
572 (options, args) = parser.parse_args() | 574 (options, args) = parser.parse_args() |
573 if not ProcessOptions(options): | 575 if not ProcessOptions(options): |
574 parser.print_help() | 576 parser.print_help() |
575 return 1 | 577 return 1 |
576 RunPushToTrunk(CONFIG, options) | 578 RunPushToTrunk(CONFIG, options) |
577 | 579 |
578 if __name__ == "__main__": | 580 if __name__ == "__main__": |
579 sys.exit(Main()) | 581 sys.exit(Main()) |
OLD | NEW |