| OLD | NEW |
| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 args = "diff svn/trunk %s" % self._state["prepare_commit_hash"] | 285 args = "diff svn/trunk %s" % self._state["prepare_commit_hash"] |
| 286 TextToFile(self.Git(args), self.Config(PATCH_FILE)) | 286 TextToFile(self.Git(args), self.Config(PATCH_FILE)) |
| 287 | 287 |
| 288 # Convert the ChangeLog entry to commit message format. | 288 # Convert the ChangeLog entry to commit message format. |
| 289 self.RestoreIfUnset("date") | 289 self.RestoreIfUnset("date") |
| 290 text = FileToText(self.Config(CHANGELOG_ENTRY_FILE)) | 290 text = FileToText(self.Config(CHANGELOG_ENTRY_FILE)) |
| 291 | 291 |
| 292 # Remove date and trailing white space. | 292 # Remove date and trailing white space. |
| 293 text = re.sub(r"^%s: " % self._state["date"], "", text.rstrip()) | 293 text = re.sub(r"^%s: " % self._state["date"], "", text.rstrip()) |
| 294 | 294 |
| 295 # Retrieve svn revision for showing the used bleeding edge revision in the |
| 296 # commit message. |
| 297 args = "svn find-rev %s" % self._state["prepare_commit_hash"] |
| 298 svn_revision = self.Git(args).strip() |
| 299 self.Persist("svn_revision", svn_revision) |
| 300 text = MSub(r"^(Version \d+\.\d+\.\d+)$", |
| 301 "\\1 (based on bleeding_edge revision r%s)" % svn_revision, |
| 302 text) |
| 303 |
| 295 # Remove indentation and merge paragraphs into single long lines, keeping | 304 # Remove indentation and merge paragraphs into single long lines, keeping |
| 296 # empty lines between them. | 305 # empty lines between them. |
| 297 def SplitMapJoin(split_text, fun, join_text): | 306 def SplitMapJoin(split_text, fun, join_text): |
| 298 return lambda text: join_text.join(map(fun, text.split(split_text))) | 307 return lambda text: join_text.join(map(fun, text.split(split_text))) |
| 299 strip = lambda line: line.strip() | 308 strip = lambda line: line.strip() |
| 300 text = SplitMapJoin("\n\n", SplitMapJoin("\n", strip, " "), "\n\n")(text) | 309 text = SplitMapJoin("\n\n", SplitMapJoin("\n", strip, " "), "\n\n")(text) |
| 301 | 310 |
| 302 if not text: | 311 if not text: |
| 303 self.Die("Commit message editing failed.") | 312 self.Die("Commit message editing failed.") |
| 304 TextToFile(text, self.Config(COMMITMSG_FILE)) | 313 TextToFile(text, self.Config(COMMITMSG_FILE)) |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 ver = "%s.%s.%s" % (self._state["major"], | 479 ver = "%s.%s.%s" % (self._state["major"], |
| 471 self._state["minor"], | 480 self._state["minor"], |
| 472 self._state["build"]) | 481 self._state["build"]) |
| 473 if self._options.r: | 482 if self._options.r: |
| 474 print "Using account %s for review." % self._options.r | 483 print "Using account %s for review." % self._options.r |
| 475 rev = self._options.r | 484 rev = self._options.r |
| 476 else: | 485 else: |
| 477 print "Please enter the email address of a reviewer for the roll CL: ", | 486 print "Please enter the email address of a reviewer for the roll CL: ", |
| 478 self.DieNoManualMode("A reviewer must be specified in forced mode.") | 487 self.DieNoManualMode("A reviewer must be specified in forced mode.") |
| 479 rev = self.ReadLine() | 488 rev = self.ReadLine() |
| 480 args = "commit -am \"Update V8 to version %s.\n\nTBR=%s\"" % (ver, rev) | 489 self.RestoreIfUnset("svn_revision") |
| 490 args = ("commit -am \"Update V8 to version %s " |
| 491 "(based on bleeding_edge revision r%s).\n\nTBR=%s\"" |
| 492 % (ver, self._state["svn_revision"], rev)) |
| 481 if self.Git(args) is None: | 493 if self.Git(args) is None: |
| 482 self.Die("'git commit' failed.") | 494 self.Die("'git commit' failed.") |
| 483 force_flag = " -f" if self._options.force_upload else "" | 495 force_flag = " -f" if self._options.force_upload else "" |
| 484 if self.Git("cl upload --send-mail%s" % force_flag, pipe=False) is None: | 496 if self.Git("cl upload --send-mail%s" % force_flag, pipe=False) is None: |
| 485 self.Die("'git cl upload' failed, please try again.") | 497 self.Die("'git cl upload' failed, please try again.") |
| 486 print "CL uploaded." | 498 print "CL uploaded." |
| 487 | 499 |
| 488 | 500 |
| 489 class SwitchV8(Step): | 501 class SwitchV8(Step): |
| 490 MESSAGE = "Returning to V8 checkout." | 502 MESSAGE = "Returning to V8 checkout." |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 def Main(): | 607 def Main(): |
| 596 parser = BuildOptions() | 608 parser = BuildOptions() |
| 597 (options, args) = parser.parse_args() | 609 (options, args) = parser.parse_args() |
| 598 if not ProcessOptions(options): | 610 if not ProcessOptions(options): |
| 599 parser.print_help() | 611 parser.print_help() |
| 600 return 1 | 612 return 1 |
| 601 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) | 613 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) |
| 602 | 614 |
| 603 if __name__ == "__main__": | 615 if __name__ == "__main__": |
| 604 sys.exit(Main()) | 616 sys.exit(Main()) |
| OLD | NEW |