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 text = MSub(r"^(Version \d+\.\d+\.\d+)$", | |
300 "\\1 (V8 revision r%s)" % svn_revision, | |
Jakob Kummerow
2014/01/23 12:57:36
Let's s/V8 revision/based on bleeding_edge revisio
Michael Achenbach
2014/01/23 13:02:42
Done.
| |
301 text) | |
302 | |
295 # Remove indentation and merge paragraphs into single long lines, keeping | 303 # Remove indentation and merge paragraphs into single long lines, keeping |
296 # empty lines between them. | 304 # empty lines between them. |
297 def SplitMapJoin(split_text, fun, join_text): | 305 def SplitMapJoin(split_text, fun, join_text): |
298 return lambda text: join_text.join(map(fun, text.split(split_text))) | 306 return lambda text: join_text.join(map(fun, text.split(split_text))) |
299 strip = lambda line: line.strip() | 307 strip = lambda line: line.strip() |
300 text = SplitMapJoin("\n\n", SplitMapJoin("\n", strip, " "), "\n\n")(text) | 308 text = SplitMapJoin("\n\n", SplitMapJoin("\n", strip, " "), "\n\n")(text) |
301 | 309 |
302 if not text: | 310 if not text: |
303 self.Die("Commit message editing failed.") | 311 self.Die("Commit message editing failed.") |
304 TextToFile(text, self.Config(COMMITMSG_FILE)) | 312 TextToFile(text, self.Config(COMMITMSG_FILE)) |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 def Main(): | 603 def Main(): |
596 parser = BuildOptions() | 604 parser = BuildOptions() |
597 (options, args) = parser.parse_args() | 605 (options, args) = parser.parse_args() |
598 if not ProcessOptions(options): | 606 if not ProcessOptions(options): |
599 parser.print_help() | 607 parser.print_help() |
600 return 1 | 608 return 1 |
601 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) | 609 RunPushToTrunk(CONFIG, PushToTrunkOptions(options)) |
602 | 610 |
603 if __name__ == "__main__": | 611 if __name__ == "__main__": |
604 sys.exit(Main()) | 612 sys.exit(Main()) |
OLD | NEW |