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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 | 982 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123 |
983 | 983 |
984 """ | 984 """ |
985 | 985 |
986 C_V8_123456_LOG = """V8 CL. | 986 C_V8_123456_LOG = """V8 CL. |
987 | 987 |
988 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 | 988 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 |
989 | 989 |
990 """ | 990 """ |
991 | 991 |
| 992 ROLL_COMMIT_MSG = """Update V8 to version 3.22.4 (based on abc). |
| 993 |
| 994 Summary of changes available at: |
| 995 https://chromium.googlesource.com/v8/v8/+log/last_rol..abc |
| 996 |
| 997 Please follow these instructions for assigning/CC'ing issues: |
| 998 https://code.google.com/p/v8-wiki/wiki/TriagingIssues |
| 999 |
| 1000 TBR=g_name@chromium.org,reviewer@chromium.org""" |
| 1001 |
992 def testChromiumRoll(self): | 1002 def testChromiumRoll(self): |
993 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG["PERSISTFILE_BASENAME"] | |
994 with open(googlers_mapping_py, "w") as f: | |
995 f.write(""" | |
996 def list_to_dict(entries): | |
997 return {"g_name@google.com": "c_name@chromium.org"} | |
998 def get_list(): | |
999 pass""") | |
1000 | |
1001 # Setup fake directory structures. | 1003 # Setup fake directory structures. |
1002 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() | 1004 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
1003 TextToFile("", os.path.join(TEST_CONFIG["CHROMIUM"], ".git")) | 1005 TextToFile("", os.path.join(TEST_CONFIG["CHROMIUM"], ".git")) |
1004 chrome_dir = TEST_CONFIG["CHROMIUM"] | 1006 chrome_dir = TEST_CONFIG["CHROMIUM"] |
1005 os.makedirs(os.path.join(chrome_dir, "v8")) | 1007 os.makedirs(os.path.join(chrome_dir, "v8")) |
1006 | 1008 |
1007 # Write fake deps file. | 1009 # Write fake deps file. |
1008 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", | 1010 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", |
1009 os.path.join(chrome_dir, "DEPS")) | 1011 os.path.join(chrome_dir, "DEPS")) |
1010 def WriteDeps(): | 1012 def WriteDeps(): |
(...skipping 17 matching lines...) Expand all Loading... |
1028 "last_roll_master_hash"), | 1030 "last_roll_master_hash"), |
1029 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", | 1031 URL("https://chromium-build.appspot.com/p/chromium/sheriff_v8.js", |
1030 "document.write('g_name')"), | 1032 "document.write('g_name')"), |
1031 Cmd("git status -s -uno", "", cwd=chrome_dir), | 1033 Cmd("git status -s -uno", "", cwd=chrome_dir), |
1032 Cmd("git checkout -f master", "", cwd=chrome_dir), | 1034 Cmd("git checkout -f master", "", cwd=chrome_dir), |
1033 Cmd("gclient sync --nohooks", "syncing...", cwd=chrome_dir), | 1035 Cmd("gclient sync --nohooks", "syncing...", cwd=chrome_dir), |
1034 Cmd("git pull", "", cwd=chrome_dir), | 1036 Cmd("git pull", "", cwd=chrome_dir), |
1035 Cmd("git fetch origin", ""), | 1037 Cmd("git fetch origin", ""), |
1036 Cmd("git new-branch v8-roll-push_hash", "", cwd=chrome_dir), | 1038 Cmd("git new-branch v8-roll-push_hash", "", cwd=chrome_dir), |
1037 Cmd("roll-dep v8 push_hash", "rolled", cb=WriteDeps, cwd=chrome_dir), | 1039 Cmd("roll-dep v8 push_hash", "rolled", cb=WriteDeps, cwd=chrome_dir), |
1038 Cmd(("git commit -am \"Update V8 to version 3.22.4 " | 1040 Cmd(("git commit -am \"%s\" " |
1039 "(based on abc).\n\n" | 1041 "--author \"author@chromium.org <author@chromium.org>\"" % |
1040 "Summary of changes available at:\n" | 1042 self.ROLL_COMMIT_MSG), |
1041 "https://chromium.googlesource.com/v8/v8/+log/last_rol..abc\n\n" | |
1042 "Please reply to the V8 sheriff c_name@chromium.org in " | |
1043 "case of problems.\n\nTBR=c_name@chromium.org\" " | |
1044 "--author \"author@chromium.org <author@chromium.org>\""), | |
1045 "", cwd=chrome_dir), | 1043 "", cwd=chrome_dir), |
1046 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f", "", | 1044 Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f", "", |
1047 cwd=chrome_dir), | 1045 cwd=chrome_dir), |
1048 ] | 1046 ] |
1049 self.Expect(expectations) | 1047 self.Expect(expectations) |
1050 | 1048 |
1051 args = ["-a", "author@chromium.org", "-c", chrome_dir, | 1049 args = ["-a", "author@chromium.org", "-c", chrome_dir, |
1052 "--sheriff", "--googlers-mapping", googlers_mapping_py, | 1050 "--sheriff", |
1053 "-r", "reviewer@chromium.org", | 1051 "-r", "reviewer@chromium.org", |
1054 "--last-roll", "last_roll_hsh"] | 1052 "--last-roll", "last_roll_hsh"] |
1055 ChromiumRoll(TEST_CONFIG, self).Run(args) | 1053 ChromiumRoll(TEST_CONFIG, self).Run(args) |
1056 | 1054 |
1057 deps = FileToText(os.path.join(chrome_dir, "DEPS")) | 1055 deps = FileToText(os.path.join(chrome_dir, "DEPS")) |
1058 self.assertTrue(re.search("\"v8_revision\": \"22624\"", deps)) | 1056 self.assertTrue(re.search("\"v8_revision\": \"22624\"", deps)) |
1059 | 1057 |
1060 def testCheckLastPushRecently(self): | 1058 def testCheckLastPushRecently(self): |
1061 self.Expect([ | 1059 self.Expect([ |
1062 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), | 1060 Cmd("git fetch origin +refs/tags/*:refs/tags/*", ""), |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 | 1547 |
1550 Review URL: https://codereview.chromium.org/83173002 | 1548 Review URL: https://codereview.chromium.org/83173002 |
1551 | 1549 |
1552 ------------------------------------------------------------------------""") | 1550 ------------------------------------------------------------------------""") |
1553 self.assertEquals( | 1551 self.assertEquals( |
1554 """Prepare push to trunk. Now working on version 3.23.11. | 1552 """Prepare push to trunk. Now working on version 3.23.11. |
1555 | 1553 |
1556 R=danno@chromium.org | 1554 R=danno@chromium.org |
1557 | 1555 |
1558 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1556 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
OLD | NEW |