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