Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 class DetectLastRoll(Step): | 41 class DetectLastRoll(Step): |
| 42 MESSAGE = "Detect commit ID of the last Chromium roll." | 42 MESSAGE = "Detect commit ID of the last Chromium roll." |
| 43 | 43 |
| 44 def RunStep(self): | 44 def RunStep(self): |
| 45 # The revision that should be rolled. Check for the latest of the most | 45 # The revision that should be rolled. Check for the latest of the most |
| 46 # recent releases based on commit timestamp. | 46 # recent releases based on commit timestamp. |
| 47 revisions = self.GetRecentReleases( | 47 revisions = self.GetRecentReleases( |
| 48 max_age=self._options.max_age * DAY_IN_SECONDS) | 48 max_age=self._options.max_age * DAY_IN_SECONDS) |
| 49 assert revisions, "Didn't find any recent release." | 49 assert revisions, "Didn't find any recent release." |
| 50 | 50 |
| 51 # Update Chromium checkout before DEPS check to fix possible race-condition | |
| 52 cwd = self._options.chromium | |
| 53 self.GitPull(cwd=cwd) | |
|
Michael Achenbach
2015/06/18 19:41:27
nit: maybe inline cwd as it's single use and doesn
| |
| 54 | |
| 51 # Interpret the DEPS file to retrieve the v8 revision. | 55 # Interpret the DEPS file to retrieve the v8 revision. |
| 52 # TODO(machenbach): This should be part or the roll-deps api of | 56 # TODO(machenbach): This should be part or the roll-deps api of |
| 53 # depot_tools. | 57 # depot_tools. |
| 54 Var = lambda var: '%s' | 58 Var = lambda var: '%s' |
| 55 exec(FileToText(os.path.join(self._options.chromium, "DEPS"))) | 59 exec(FileToText(os.path.join(self._options.chromium, "DEPS"))) |
| 56 | 60 |
| 57 # The revision rolled last. | 61 # The revision rolled last. |
| 58 self["last_roll"] = vars['v8_revision'] | 62 self["last_roll"] = vars['v8_revision'] |
| 59 last_version = self.GetVersionTag(self["last_roll"]) | 63 last_version = self.GetVersionTag(self["last_roll"]) |
| 60 assert last_version, "The last rolled v8 revision is not tagged." | 64 assert last_version, "The last rolled v8 revision is not tagged." |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 def _Steps(self): | 130 def _Steps(self): |
| 127 return [ | 131 return [ |
| 128 CheckActiveRoll, | 132 CheckActiveRoll, |
| 129 DetectLastRoll, | 133 DetectLastRoll, |
| 130 RollChromium, | 134 RollChromium, |
| 131 ] | 135 ] |
| 132 | 136 |
| 133 | 137 |
| 134 if __name__ == "__main__": # pragma: no cover | 138 if __name__ == "__main__": # pragma: no cover |
| 135 sys.exit(AutoRoll().Run()) | 139 sys.exit(AutoRoll().Run()) |
| OLD | NEW |