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