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 f.write(" // Some line...\n") | |
398 f.write("\n") | |
399 f.write("'merges': [") | |
400 f.write("# Only enabled on branches created with tools/release/create_rele ase.py") | |
401 f.write("# 'v8-merges@googlegroups.com',") | |
Michael Achenbach
2016/02/04 08:19:41
Please add the same whitespace as in the original
Michael Hablich
2016/02/04 09:01:22
Ack and done. Just copied the style in the method
| |
402 f.write("],") | |
403 | |
392 def MakeStep(self): | 404 def MakeStep(self): |
393 """Convenience wrapper.""" | 405 """Convenience wrapper.""" |
394 options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) | 406 options = ScriptsBase(TEST_CONFIG, self, self._state).MakeOptions([]) |
395 return MakeStep(step_class=Step, state=self._state, | 407 return MakeStep(step_class=Step, state=self._state, |
396 config=TEST_CONFIG, side_effect_handler=self, | 408 config=TEST_CONFIG, side_effect_handler=self, |
397 options=options) | 409 options=options) |
398 | 410 |
399 def RunStep(self, script=PushToCandidates, step_class=Step, args=None): | 411 def RunStep(self, script=PushToCandidates, step_class=Step, args=None): |
400 """Convenience wrapper.""" | 412 """Convenience wrapper.""" |
401 args = args if args is not None else ["-m"] | 413 args = args if args is not None else ["-m"] |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
902 | 914 |
903 def CheckVersionCommit(): | 915 def CheckVersionCommit(): |
904 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) | 916 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
905 self.assertEquals(commit_msg, commit) | 917 self.assertEquals(commit_msg, commit) |
906 version = FileToText( | 918 version = FileToText( |
907 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) | 919 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) |
908 self.assertTrue(re.search(r"#define V8_MINOR_VERSION\s+22", version)) | 920 self.assertTrue(re.search(r"#define V8_MINOR_VERSION\s+22", version)) |
909 self.assertTrue(re.search(r"#define V8_BUILD_NUMBER\s+5", version)) | 921 self.assertTrue(re.search(r"#define V8_BUILD_NUMBER\s+5", version)) |
910 self.assertFalse(re.search(r"#define V8_BUILD_NUMBER\s+6", version)) | 922 self.assertFalse(re.search(r"#define V8_BUILD_NUMBER\s+6", version)) |
911 self.assertTrue(re.search(r"#define V8_PATCH_LEVEL\s+0", version)) | 923 self.assertTrue(re.search(r"#define V8_PATCH_LEVEL\s+0", version)) |
912 self.assertTrue( | 924 self.assertTrue( |
Michael Achenbach
2016/02/04 08:19:41
optional: You could add an assert here to check th
Michael Hablich
2016/02/04 09:01:22
Done. Added it to the bottom after all the work wa
Michael Achenbach
2016/02/04 09:28:45
Makes only sense because the tests are incorrect (
| |
913 re.search(r"#define V8_IS_CANDIDATE_VERSION\s+0", version)) | 925 re.search(r"#define V8_IS_CANDIDATE_VERSION\s+0", version)) |
914 | 926 |
915 # Check that the change log on the candidates branch got correctly | 927 # Check that the change log on the candidates branch got correctly |
916 # modified. | 928 # modified. |
917 change_log = FileToText( | 929 change_log = FileToText( |
918 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) | 930 os.path.join(TEST_CONFIG["DEFAULT_CWD"], CHANGELOG_FILE)) |
919 self.assertEquals( | 931 self.assertEquals( |
920 """1999-07-31: Version 3.22.5 | 932 """1999-07-31: Version 3.22.5 |
921 | 933 |
922 Log text 1 (issue 321). | 934 Log text 1 (issue 321). |
(...skipping 22 matching lines...) Expand all Loading... | |
945 Cmd("git log -1 --format=%H release_hash^", "abc3\n"), | 957 Cmd("git log -1 --format=%H release_hash^", "abc3\n"), |
946 Cmd("git log --format=%H abc3..push_hash", "rev1\n"), | 958 Cmd("git log --format=%H abc3..push_hash", "rev1\n"), |
947 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), | 959 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"), | 960 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"), | 961 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), |
950 Cmd("git reset --hard origin/master", ""), | 962 Cmd("git reset --hard origin/master", ""), |
951 Cmd("git checkout -b work-branch push_hash", ""), | 963 Cmd("git checkout -b work-branch push_hash", ""), |
952 Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), | 964 Cmd("git checkout -f 3.22.4 -- ChangeLog", "", cb=ResetChangeLog), |
953 Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", | 965 Cmd("git checkout -f 3.22.4 -- include/v8-version.h", "", |
954 cb=self.WriteFakeVersionFile), | 966 cb=self.WriteFakeVersionFile), |
967 Cmd("git checkout -f 3.22.4 -- WATCHLISTS", "", | |
968 cb=self.WriteFakeWatchlistsFile), | |
955 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", | 969 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", |
956 cb=CheckVersionCommit), | 970 cb=CheckVersionCommit), |
957 Cmd("git push origin " | 971 Cmd("git push origin " |
958 "refs/heads/work-branch:refs/pending/heads/3.22.5 " | 972 "refs/heads/work-branch:refs/pending/heads/3.22.5 " |
959 "push_hash:refs/pending-tags/heads/3.22.5 " | 973 "push_hash:refs/pending-tags/heads/3.22.5 " |
960 "push_hash:refs/heads/3.22.5", ""), | 974 "push_hash:refs/heads/3.22.5", ""), |
961 Cmd("git fetch", ""), | 975 Cmd("git fetch", ""), |
962 Cmd("git log -1 --format=%H --grep=" | 976 Cmd("git log -1 --format=%H --grep=" |
963 "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), | 977 "\"Version 3.22.5\" origin/3.22.5", "hsh_to_tag"), |
964 Cmd("git tag 3.22.5 hsh_to_tag", ""), | 978 Cmd("git tag 3.22.5 hsh_to_tag", ""), |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1543 | 1557 |
1544 Review URL: https://codereview.chromium.org/83173002 | 1558 Review URL: https://codereview.chromium.org/83173002 |
1545 | 1559 |
1546 ------------------------------------------------------------------------""") | 1560 ------------------------------------------------------------------------""") |
1547 self.assertEquals( | 1561 self.assertEquals( |
1548 """Prepare push to trunk. Now working on version 3.23.11. | 1562 """Prepare push to trunk. Now working on version 3.23.11. |
1549 | 1563 |
1550 R=danno@chromium.org | 1564 R=danno@chromium.org |
1551 | 1565 |
1552 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1566 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |