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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 result = self.ReadURL(search_url, params, wait_plan=[5, 20]) | 43 result = self.ReadURL(search_url, params, wait_plan=[5, 20]) |
44 if self.ContainsChromiumRoll(json.loads(result)["results"]): | 44 if self.ContainsChromiumRoll(json.loads(result)["results"]): |
45 print "Stop due to existing Chromium roll." | 45 print "Stop due to existing Chromium roll." |
46 return True | 46 return True |
47 | 47 |
48 | 48 |
49 class DetectLastPush(Step): | 49 class DetectLastPush(Step): |
50 MESSAGE = "Detect commit ID of the last push to trunk." | 50 MESSAGE = "Detect commit ID of the last push to trunk." |
51 | 51 |
52 def RunStep(self): | 52 def RunStep(self): |
53 push_hash = self.FindLastTrunkPush(include_patches=True) | 53 push_hash = self.FindLastTrunkPush( |
54 self["last_push"] = self.GitSVNFindSVNRev(push_hash) | 54 branch="origin/master", include_patches=True) |
| 55 self["last_push"] = self.GetCommitPositionNumber(push_hash) |
55 | 56 |
56 | 57 |
57 class DetectLastRoll(Step): | 58 class DetectLastRoll(Step): |
58 MESSAGE = "Detect commit ID of the last Chromium roll." | 59 MESSAGE = "Detect commit ID of the last Chromium roll." |
59 | 60 |
60 def RunStep(self): | 61 def RunStep(self): |
61 # Interpret the DEPS file to retrieve the v8 revision. | 62 # Interpret the DEPS file to retrieve the v8 revision. |
62 Var = lambda var: '%s' | 63 Var = lambda var: '%s' |
63 exec(self.ReadURL(CR_DEPS_URL)) | 64 exec(self.ReadURL(CR_DEPS_URL)) |
64 last_roll = vars['v8_revision'] | 65 last_roll = vars['v8_revision'] |
65 if last_roll >= self["last_push"]: | 66 # FIXME(machenbach): When rolling from bleeding edge and from trunk there |
| 67 # be different commit numbers here. Better use version? |
| 68 if int(last_roll) >= int(self["last_push"]): |
66 print("There is no newer v8 revision than the one in Chromium (%s)." | 69 print("There is no newer v8 revision than the one in Chromium (%s)." |
67 % last_roll) | 70 % last_roll) |
68 return True | 71 return True |
69 | 72 |
70 | 73 |
71 class CheckClusterFuzz(Step): | 74 class CheckClusterFuzz(Step): |
72 MESSAGE = "Check ClusterFuzz api for new problems." | 75 MESSAGE = "Check ClusterFuzz api for new problems." |
73 | 76 |
74 def RunStep(self): | 77 def RunStep(self): |
75 if not os.path.exists(self.Config(CLUSTERFUZZ_API_KEY_FILE)): | 78 if not os.path.exists(self.Config(CLUSTERFUZZ_API_KEY_FILE)): |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 CheckActiveRoll, | 133 CheckActiveRoll, |
131 DetectLastPush, | 134 DetectLastPush, |
132 DetectLastRoll, | 135 DetectLastRoll, |
133 CheckClusterFuzz, | 136 CheckClusterFuzz, |
134 RollChromium, | 137 RollChromium, |
135 ] | 138 ] |
136 | 139 |
137 | 140 |
138 if __name__ == "__main__": # pragma: no cover | 141 if __name__ == "__main__": # pragma: no cover |
139 sys.exit(AutoRoll(CONFIG).Run()) | 142 sys.exit(AutoRoll(CONFIG).Run()) |
OLD | NEW |