Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: tools/push-to-trunk/push_to_trunk.py

Issue 710593003: Fix change log creation in push script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 os.remove(self.Config("PATCH_FILE")) 312 os.remove(self.Config("PATCH_FILE"))
313 313
314 314
315 class AddChangeLog(Step): 315 class AddChangeLog(Step):
316 MESSAGE = "Add ChangeLog changes to trunk branch." 316 MESSAGE = "Add ChangeLog changes to trunk branch."
317 317
318 def RunStep(self): 318 def RunStep(self):
319 # The change log has been modified by the patch. Reset it to the version 319 # The change log has been modified by the patch. Reset it to the version
320 # on trunk and apply the exact changes determined by this PrepareChangeLog 320 # on trunk and apply the exact changes determined by this PrepareChangeLog
321 # step above. 321 # step above.
322 self.GitCheckoutFile(self.Config("CHANGELOG_FILE"), 322 self.GitCheckoutFile(CHANGELOG_FILE, self.vc.RemoteCandidateBranch())
323 self.vc.RemoteCandidateBranch())
324 changelog_entry = FileToText(self.Config("CHANGELOG_ENTRY_FILE")) 323 changelog_entry = FileToText(self.Config("CHANGELOG_ENTRY_FILE"))
325 old_change_log = FileToText(self.Config("CHANGELOG_FILE")) 324 old_change_log = FileToText(os.path.join(self.default_cwd, CHANGELOG_FILE))
326 new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log) 325 new_change_log = "%s\n\n\n%s" % (changelog_entry, old_change_log)
327 TextToFile(new_change_log, self.Config("CHANGELOG_FILE")) 326 TextToFile(new_change_log, os.path.join(self.default_cwd, CHANGELOG_FILE))
328 os.remove(self.Config("CHANGELOG_ENTRY_FILE")) 327 os.remove(self.Config("CHANGELOG_ENTRY_FILE"))
329 328
330 329
331 class SetVersion(Step): 330 class SetVersion(Step):
332 MESSAGE = "Set correct version for trunk." 331 MESSAGE = "Set correct version for trunk."
333 332
334 def RunStep(self): 333 def RunStep(self):
335 # The version file has been modified by the patch. Reset it to the version 334 # The version file has been modified by the patch. Reset it to the version
336 # on trunk and apply the correct version. 335 # on trunk and apply the correct version.
337 self.GitCheckoutFile(VERSION_FILE, self.vc.RemoteCandidateBranch()) 336 self.GitCheckoutFile(VERSION_FILE, self.vc.RemoteCandidateBranch())
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 return False 415 return False
417 416
418 options.tbr_commit = not options.manual 417 options.tbr_commit = not options.manual
419 return True 418 return True
420 419
421 def _Config(self): 420 def _Config(self):
422 return { 421 return {
423 "BRANCHNAME": "prepare-push", 422 "BRANCHNAME": "prepare-push",
424 "TRUNKBRANCH": "trunk-push", 423 "TRUNKBRANCH": "trunk-push",
425 "PERSISTFILE_BASENAME": "/tmp/v8-push-to-trunk-tempfile", 424 "PERSISTFILE_BASENAME": "/tmp/v8-push-to-trunk-tempfile",
426 "CHANGELOG_FILE": "ChangeLog",
427 "CHANGELOG_ENTRY_FILE": "/tmp/v8-push-to-trunk-tempfile-changelog-entry", 425 "CHANGELOG_ENTRY_FILE": "/tmp/v8-push-to-trunk-tempfile-changelog-entry",
428 "PATCH_FILE": "/tmp/v8-push-to-trunk-tempfile-patch-file", 426 "PATCH_FILE": "/tmp/v8-push-to-trunk-tempfile-patch-file",
429 "COMMITMSG_FILE": "/tmp/v8-push-to-trunk-tempfile-commitmsg", 427 "COMMITMSG_FILE": "/tmp/v8-push-to-trunk-tempfile-commitmsg",
430 } 428 }
431 429
432 def _Steps(self): 430 def _Steps(self):
433 return [ 431 return [
434 Preparation, 432 Preparation,
435 FreshBranch, 433 FreshBranch,
436 PreparePushRevision, 434 PreparePushRevision,
(...skipping 11 matching lines...) Expand all
448 CommitTrunk, 446 CommitTrunk,
449 SanityCheck, 447 SanityCheck,
450 CommitSVN, 448 CommitSVN,
451 TagRevision, 449 TagRevision,
452 CleanUp, 450 CleanUp,
453 ] 451 ]
454 452
455 453
456 if __name__ == "__main__": # pragma: no cover 454 if __name__ == "__main__": # pragma: no cover
457 sys.exit(PushToTrunk().Run()) 455 sys.exit(PushToTrunk().Run())
OLDNEW
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698