OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 the V8 project authors. All rights reserved. | 2 # Copyright 2015 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 os | 7 import os |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 import urllib2 | 10 import urllib2 |
11 | 11 |
12 from common_includes import * | 12 from common_includes import * |
13 | 13 |
14 | |
15 class Preparation(Step): | 14 class Preparation(Step): |
16 MESSAGE = "Preparation." | 15 MESSAGE = "Preparation." |
17 | 16 |
18 def RunStep(self): | 17 def RunStep(self): |
19 fetchspecs = [ | 18 fetchspecs = [ |
20 "+refs/heads/*:refs/heads/*", | 19 "+refs/heads/*:refs/heads/*", |
21 "+refs/pending/*:refs/pending/*", | 20 "+refs/pending/*:refs/pending/*", |
22 "+refs/pending-tags/*:refs/pending-tags/*", | 21 "+refs/pending-tags/*:refs/pending-tags/*", |
23 ] | 22 ] |
24 self.Git("fetch origin %s" % " ".join(fetchspecs)) | 23 self.Git("fetch origin %s" % " ".join(fetchspecs)) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 156 |
158 | 157 |
159 class MakeBranch(Step): | 158 class MakeBranch(Step): |
160 MESSAGE = "Create the branch." | 159 MESSAGE = "Create the branch." |
161 | 160 |
162 def RunStep(self): | 161 def RunStep(self): |
163 self.Git("reset --hard origin/master") | 162 self.Git("reset --hard origin/master") |
164 self.Git("checkout -b work-branch %s" % self["push_hash"]) | 163 self.Git("checkout -b work-branch %s" % self["push_hash"]) |
165 self.GitCheckoutFile(CHANGELOG_FILE, self["latest_version"]) | 164 self.GitCheckoutFile(CHANGELOG_FILE, self["latest_version"]) |
166 self.GitCheckoutFile(VERSION_FILE, self["latest_version"]) | 165 self.GitCheckoutFile(VERSION_FILE, self["latest_version"]) |
| 166 self.GitCheckoutFile(WATCHLISTS_FILE, self["latest_version"]) |
167 | 167 |
168 | 168 |
169 class AddChangeLog(Step): | 169 class AddChangeLog(Step): |
170 MESSAGE = "Add ChangeLog changes to release branch." | 170 MESSAGE = "Add ChangeLog changes to release branch." |
171 | 171 |
172 def RunStep(self): | 172 def RunStep(self): |
173 changelog_entry = FileToText(self.Config("CHANGELOG_ENTRY_FILE")) | 173 changelog_entry = FileToText(self.Config("CHANGELOG_ENTRY_FILE")) |
174 old_change_log = FileToText(os.path.join(self.default_cwd, CHANGELOG_FILE)) | 174 old_change_log = FileToText(os.path.join(self.default_cwd, CHANGELOG_FILE)) |
175 new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log) | 175 new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log) |
176 TextToFile(new_change_log, os.path.join(self.default_cwd, CHANGELOG_FILE)) | 176 TextToFile(new_change_log, os.path.join(self.default_cwd, CHANGELOG_FILE)) |
177 | 177 |
178 | 178 |
179 class SetVersion(Step): | 179 class SetVersion(Step): |
180 MESSAGE = "Set correct version for candidates." | 180 MESSAGE = "Set correct version for candidates." |
181 | 181 |
182 def RunStep(self): | 182 def RunStep(self): |
183 self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_") | 183 self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_") |
184 | 184 |
185 | 185 |
| 186 class EnableMergeWatchlist(Step): |
| 187 MESSAGE = "Enable watchlist entry for merge notifications." |
| 188 |
| 189 def RunStep(self): |
| 190 old_watchlist_content = FileToText(os.path.join(self.default_cwd, |
| 191 WATCHLISTS_FILE)) |
| 192 new_watchlist_content = re.sub("(# 'v8-merges@googlegroups\.com',)", |
| 193 "'v8-merges@googlegroups.com',", |
| 194 old_watchlist_content) |
| 195 TextToFile(new_watchlist_content, os.path.join(self.default_cwd, |
| 196 WATCHLISTS_FILE)) |
| 197 |
| 198 |
186 class CommitBranch(Step): | 199 class CommitBranch(Step): |
187 MESSAGE = "Commit version and changelog to new branch." | 200 MESSAGE = "Commit version and changelog to new branch." |
188 | 201 |
189 def RunStep(self): | 202 def RunStep(self): |
190 # Convert the ChangeLog entry to commit message format. | 203 # Convert the ChangeLog entry to commit message format. |
191 text = FileToText(self.Config("CHANGELOG_ENTRY_FILE")) | 204 text = FileToText(self.Config("CHANGELOG_ENTRY_FILE")) |
192 | 205 |
193 # Remove date and trailing white space. | 206 # Remove date and trailing white space. |
194 text = re.sub(r"^%s: " % self["date"], "", text.rstrip()) | 207 text = re.sub(r"^%s: " % self["date"], "", text.rstrip()) |
195 | 208 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 return [ | 294 return [ |
282 Preparation, | 295 Preparation, |
283 PrepareBranchRevision, | 296 PrepareBranchRevision, |
284 IncrementVersion, | 297 IncrementVersion, |
285 DetectLastRelease, | 298 DetectLastRelease, |
286 PrepareChangeLog, | 299 PrepareChangeLog, |
287 EditChangeLog, | 300 EditChangeLog, |
288 MakeBranch, | 301 MakeBranch, |
289 AddChangeLog, | 302 AddChangeLog, |
290 SetVersion, | 303 SetVersion, |
| 304 EnableMergeWatchlist, |
291 CommitBranch, | 305 CommitBranch, |
292 PushBranch, | 306 PushBranch, |
293 TagRevision, | 307 TagRevision, |
294 CleanUp, | 308 CleanUp, |
295 ] | 309 ] |
296 | 310 |
297 | 311 |
298 if __name__ == "__main__": # pragma: no cover | 312 if __name__ == "__main__": # pragma: no cover |
299 sys.exit(CreateRelease().Run()) | 313 sys.exit(CreateRelease().Run()) |
OLD | NEW |