| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 with open(version_file, "w") as f: | 382 with open(version_file, "w") as f: |
| 383 f.write(" // Some line...\n") | 383 f.write(" // Some line...\n") |
| 384 f.write("\n") | 384 f.write("\n") |
| 385 f.write("#define V8_MAJOR_VERSION %s\n" % major) | 385 f.write("#define V8_MAJOR_VERSION %s\n" % major) |
| 386 f.write("#define V8_MINOR_VERSION %s\n" % minor) | 386 f.write("#define V8_MINOR_VERSION %s\n" % minor) |
| 387 f.write("#define V8_BUILD_NUMBER %s\n" % build) | 387 f.write("#define V8_BUILD_NUMBER %s\n" % build) |
| 388 f.write("#define V8_PATCH_LEVEL %s\n" % patch) | 388 f.write("#define V8_PATCH_LEVEL %s\n" % patch) |
| 389 f.write(" // Some line...\n") | 389 f.write(" // Some line...\n") |
| 390 f.write("#define V8_IS_CANDIDATE_VERSION 0\n") | 390 f.write("#define V8_IS_CANDIDATE_VERSION 0\n") |
| 391 | 391 |
| 392 def WriteFakeWatchlistsFile(self): |
| 393 watchlists_file = os.path.join(TEST_CONFIG["DEFAULT_CWD"], WATCHLISTS_FILE) |
| 394 if not os.path.exists(os.path.dirname(watchlists_file)): |
| 395 os.makedirs(os.path.dirname(watchlists_file)) |
| 396 with open(watchlists_file, "w") as f: |
| 397 |
| 398 content = """ |
| 399 'merges': [ |
| 400 # Only enabled on branches created with tools/release/create_release.py |
| 401 # 'v8-merges@googlegroups.com', |
| 402 ], |
| 403 """ |
| 404 f.write(content) |
| 405 |
| 392 def MakeStep(self): | 406 def MakeStep(self): |
| 393 """Convenience wrapper.""" | 407 """Convenience wrapper.""" |
| 394 options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) | 408 options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) |
| 395 return MakeStep(step_class=Step, state=self._state, | 409 return MakeStep(step_class=Step, state=self._state, |
| 396 config=TEST_CONFIG, side_effect_handler=self, | 410 config=TEST_CONFIG, side_effect_handler=self, |
| 397 options=options) | 411 options=options) |
| 398 | 412 |
| 399 def RunStep(self, script=PushToCandidates, step_class=Step, args=None): | 413 def RunStep(self, script=PushToCandidates, step_class=Step, args=None): |
| 400 """Convenience wrapper.""" | 414 """Convenience wrapper.""" |
| 401 args = args if args is not None else ["-m"] | 415 args = args if args is not None else ["-m"] |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 Cmd("git log -1 --format=%H release_hash^", "abc3\n"), | 959 Cmd("git log -1 --format=%H release_hash^", "abc3\n"), |
| 946 Cmd("git log --format=%H abc3..push_hash", "rev1\n"), | 960 Cmd("git log --format=%H abc3..push_hash", "rev1\n"), |
| 947 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), | 961 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), |
| 948 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"), | 962 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"), |
| 949 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), | 963 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), |
| 950 Cmd("git reset --hard origin/master", ""), | 964 Cmd("git reset --hard origin/master", ""), |
| 951 Cmd("git checkout -b work-branch push_hash", ""), | 965 Cmd("git checkout -b work-branch push_hash", ""), |
| 952 Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), | 966 Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), |
| 953 Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", | 967 Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", |
| 954 cb=self.WriteFakeVersionFile), | 968 cb=self.WriteFakeVersionFile), |
| 969 Cmd("git checkout -f 3.22.4 -- WATCHLISTS", "", |
| 970 cb=self.WriteFakeWatchlistsFile), |
| 955 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", | 971 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", |
| 956 cb=CheckVersionCommit), | 972 cb=CheckVersionCommit), |
| 957 Cmd("git push origin " | 973 Cmd("git push origin " |
| 958 "refs/heads/work-branch:refs/pending/heads/3.22.5 " | 974 "refs/heads/work-branch:refs/pending/heads/3.22.5 " |
| 959 "push_hash:refs/pending-tags/heads/3.22.5 " | 975 "push_hash:refs/pending-tags/heads/3.22.5 " |
| 960 "push_hash:refs/heads/3.22.5", ""), | 976 "push_hash:refs/heads/3.22.5", ""), |
| 961 Cmd("git fetch", ""), | 977 Cmd("git fetch", ""), |
| 962 Cmd("git log -1 --format=%H --grep=" | 978 Cmd("git log -1 --format=%H --grep=" |
| 963 "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), | 979 "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), |
| 964 Cmd("git tag 3.22.5 hsh_to_tag", ""), | 980 Cmd("git tag 3.22.5 hsh_to_tag", ""), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 976 CreateRelease(TEST_CONFIG, self).Run(args) | 992 CreateRelease(TEST_CONFIG, self).Run(args) |
| 977 | 993 |
| 978 cl = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) | 994 cl = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) |
| 979 self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl)) | 995 self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl)) |
| 980 self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl)) | 996 self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl)) |
| 981 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl)) | 997 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl)) |
| 982 | 998 |
| 983 # Note: The version file is on build number 5 again in the end of this test | 999 # Note: The version file is on build number 5 again in the end of this test |
| 984 # since the git command that merges to master is mocked out. | 1000 # since the git command that merges to master is mocked out. |
| 985 | 1001 |
| 1002 # Check for correct content of the WATCHLISTS file |
| 1003 |
| 1004 watchlists_content = FileToText(os.path.join(TEST_CONFIG["DEFAULT_CWD"], |
| 1005 WATCHLISTS_FILE)) |
| 1006 expected_watchlists_content = """ |
| 1007 'merges': [ |
| 1008 # Only enabled on branches created with tools/release/create_release.py |
| 1009 'v8-merges@googlegroups.com', |
| 1010 ], |
| 1011 """ |
| 1012 self.assertEqual(watchlists_content, expected_watchlists_content) |
| 1013 |
| 986 C_V8_22624_LOG = """V8 CL. | 1014 C_V8_22624_LOG = """V8 CL. |
| 987 | 1015 |
| 988 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 | 1016 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 |
| 989 | 1017 |
| 990 """ | 1018 """ |
| 991 | 1019 |
| 992 C_V8_123455_LOG = """V8 CL. | 1020 C_V8_123455_LOG = """V8 CL. |
| 993 | 1021 |
| 994 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 | 1022 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 |
| 995 | 1023 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 | 1571 |
| 1544 Review URL: https://codereview.chromium.org/83173002 | 1572 Review URL: https://codereview.chromium.org/83173002 |
| 1545 | 1573 |
| 1546 ------------------------------------------------------------------------""") | 1574 ------------------------------------------------------------------------""") |
| 1547 self.assertEquals( | 1575 self.assertEquals( |
| 1548 """Prepare push to trunk. Now working on version 3.23.11. | 1576 """Prepare push to trunk. Now working on version 3.23.11. |
| 1549 | 1577 |
| 1550 R=danno@chromium.org | 1578 R=danno@chromium.org |
| 1551 | 1579 |
| 1552 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1580 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
| OLD | NEW |