OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import argparse | 6 import argparse |
7 import json | 7 import json |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 import urllib | 10 import urllib |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 # The revision that should be rolled. | 45 # The revision that should be rolled. |
46 latest_release = self.GetLatestRelease() | 46 latest_release = self.GetLatestRelease() |
47 | 47 |
48 # Interpret the DEPS file to retrieve the v8 revision. | 48 # Interpret the DEPS file to retrieve the v8 revision. |
49 # TODO(machenbach): This should be part or the roll-deps api of | 49 # TODO(machenbach): This should be part or the roll-deps api of |
50 # depot_tools. | 50 # depot_tools. |
51 Var = lambda var: '%s' | 51 Var = lambda var: '%s' |
52 exec(FileToText(os.path.join(self._options.chromium, "DEPS"))) | 52 exec(FileToText(os.path.join(self._options.chromium, "DEPS"))) |
53 | 53 |
54 # The revision rolled last. | 54 # The revision rolled last. |
55 last_roll = vars['v8_revision'] | 55 self["last_roll"] = vars['v8_revision'] |
56 | 56 |
57 # TODO(machenbach): It is possible that the auto-push script made a new | 57 # TODO(machenbach): It is possible that the auto-push script made a new |
58 # fast-forward release (e.g. 4.2.3) while somebody patches the last | 58 # fast-forward release (e.g. 4.2.3) while somebody patches the last |
59 # candidate (e.g. 4.2.2.1). In this case, the auto-roller would pick | 59 # candidate (e.g. 4.2.2.1). In this case, the auto-roller would pick |
60 # the fast-forward release. Should there be a way to prioritize the | 60 # the fast-forward release. Should there be a way to prioritize the |
61 # patched version? | 61 # patched version? |
62 | 62 |
63 if latest_release == last_roll: | 63 if latest_release == self["last_roll"]: |
64 # We always try to roll if the latest revision is not the revision in | 64 # We always try to roll if the latest revision is not the revision in |
65 # chromium. | 65 # chromium. |
66 print("There is no newer v8 revision than the one in Chromium (%s)." | 66 print("There is no newer v8 revision than the one in Chromium (%s)." |
67 % last_roll) | 67 % self["last_roll"]) |
68 return True | 68 return True |
69 | 69 |
70 | 70 |
71 class CheckClusterFuzz(Step): | 71 class CheckClusterFuzz(Step): |
72 MESSAGE = "Check ClusterFuzz api for new problems." | 72 MESSAGE = "Check ClusterFuzz api for new problems." |
73 | 73 |
74 def RunStep(self): | 74 def RunStep(self): |
75 if not os.path.exists(self.Config("CLUSTERFUZZ_API_KEY_FILE")): | 75 if not os.path.exists(self.Config("CLUSTERFUZZ_API_KEY_FILE")): |
76 print "Skipping ClusterFuzz check. No api key file found." | 76 print "Skipping ClusterFuzz check. No api key file found." |
77 return False | 77 return False |
(...skipping 10 matching lines...) Expand all Loading... |
88 | 88 |
89 class RollChromium(Step): | 89 class RollChromium(Step): |
90 MESSAGE = "Roll V8 into Chromium." | 90 MESSAGE = "Roll V8 into Chromium." |
91 | 91 |
92 def RunStep(self): | 92 def RunStep(self): |
93 if self._options.roll: | 93 if self._options.roll: |
94 args = [ | 94 args = [ |
95 "--author", self._options.author, | 95 "--author", self._options.author, |
96 "--reviewer", self._options.reviewer, | 96 "--reviewer", self._options.reviewer, |
97 "--chromium", self._options.chromium, | 97 "--chromium", self._options.chromium, |
| 98 "--last-roll", self["last_roll"], |
98 "--use-commit-queue", | 99 "--use-commit-queue", |
99 ] | 100 ] |
100 if self._options.sheriff: | 101 if self._options.sheriff: |
101 args.extend([ | 102 args.extend([ |
102 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) | 103 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) |
103 if self._options.dry_run: | 104 if self._options.dry_run: |
104 args.extend(["--dry-run"]) | 105 args.extend(["--dry-run"]) |
105 if self._options.work_dir: | 106 if self._options.work_dir: |
106 args.extend(["--work-dir", self._options.work_dir]) | 107 args.extend(["--work-dir", self._options.work_dir]) |
107 self._side_effect_handler.Call(chromium_roll.ChromiumRoll().Run, args) | 108 self._side_effect_handler.Call(chromium_roll.ChromiumRoll().Run, args) |
(...skipping 26 matching lines...) Expand all Loading... |
134 return [ | 135 return [ |
135 CheckActiveRoll, | 136 CheckActiveRoll, |
136 DetectLastRoll, | 137 DetectLastRoll, |
137 CheckClusterFuzz, | 138 CheckClusterFuzz, |
138 RollChromium, | 139 RollChromium, |
139 ] | 140 ] |
140 | 141 |
141 | 142 |
142 if __name__ == "__main__": # pragma: no cover | 143 if __name__ == "__main__": # pragma: no cover |
143 sys.exit(AutoRoll().Run()) | 144 sys.exit(AutoRoll().Run()) |
OLD | NEW |