| 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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 TEST_CONFIG["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile() | 1150 TEST_CONFIG["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile() |
| 1151 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 1151 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 1152 self.WriteFakeVersionFile(build=5) | 1152 self.WriteFakeVersionFile(build=5) |
| 1153 os.environ["EDITOR"] = "vi" | 1153 os.environ["EDITOR"] = "vi" |
| 1154 extra_patch = self.MakeEmptyTempFile() | 1154 extra_patch = self.MakeEmptyTempFile() |
| 1155 | 1155 |
| 1156 def VerifyPatch(patch): | 1156 def VerifyPatch(patch): |
| 1157 return lambda: self.assertEquals(patch, | 1157 return lambda: self.assertEquals(patch, |
| 1158 FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"])) | 1158 FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"])) |
| 1159 | 1159 |
| 1160 msg = """Version 3.22.5.1 (cherry-pick) | 1160 msg = """Merged: Squashed multiple commits. |
| 1161 | 1161 |
| 1162 Merged ab12345 | 1162 Merged: Title4 |
| 1163 Merged ab23456 | 1163 Hash: ab12345 |
| 1164 Merged ab34567 | |
| 1165 Merged ab45678 | |
| 1166 Merged ab56789 | |
| 1167 | 1164 |
| 1168 Title4 | 1165 Merged: Title2 |
| 1166 Hash: ab23456 |
| 1169 | 1167 |
| 1170 Title2 | 1168 Merged: Title3 |
| 1169 Hash: ab34567 |
| 1171 | 1170 |
| 1172 Title3 | 1171 Merged: Title1 |
| 1172 Hash: ab45678 |
| 1173 | 1173 |
| 1174 Title1 | 1174 Merged: Revert \"Something\" |
| 1175 | 1175 Hash: ab56789 |
| 1176 Revert "Something" | |
| 1177 | 1176 |
| 1178 BUG=123,234,345,456,567,v8:123 | 1177 BUG=123,234,345,456,567,v8:123 |
| 1179 LOG=N | 1178 LOG=N |
| 1180 """ | 1179 """ |
| 1181 | 1180 |
| 1182 def VerifyLand(): | 1181 def VerifyLand(): |
| 1183 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) | 1182 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
| 1184 self.assertEquals(msg, commit) | 1183 self.assertEquals(msg, commit) |
| 1185 version = FileToText( | |
| 1186 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) | |
| 1187 self.assertTrue(re.search(r"#define V8_MINOR_VERSION\s+22", version)) | |
| 1188 self.assertTrue(re.search(r"#define V8_BUILD_NUMBER\s+5", version)) | |
| 1189 self.assertTrue(re.search(r"#define V8_PATCH_LEVEL\s+1", version)) | |
| 1190 self.assertTrue( | |
| 1191 re.search(r"#define V8_IS_CANDIDATE_VERSION\s+0", version)) | |
| 1192 | 1184 |
| 1193 self.Expect([ | 1185 self.Expect([ |
| 1194 Cmd("git status -s -uno", ""), | 1186 Cmd("git status -s -uno", ""), |
| 1195 Cmd("git checkout -f origin/master", ""), | 1187 Cmd("git checkout -f origin/master", ""), |
| 1196 Cmd("git fetch", ""), | 1188 Cmd("git fetch", ""), |
| 1197 Cmd("git branch", " branch1\n* branch2\n"), | 1189 Cmd("git branch", " branch1\n* branch2\n"), |
| 1198 Cmd("git new-branch %s --upstream refs/remotes/origin/candidates" % | 1190 Cmd("git new-branch %s --upstream refs/remotes/origin/candidates" % |
| 1199 TEST_CONFIG["BRANCHNAME"], ""), | 1191 TEST_CONFIG["BRANCHNAME"], ""), |
| 1200 Cmd(("git log --format=%H --grep=\"Port ab12345\" " | 1192 Cmd(("git log --format=%H --grep=\"^[P,p]ort ab12345\" " |
| 1201 "--reverse origin/master"), | 1193 "--reverse origin/master"), |
| 1202 "ab45678\nab23456"), | 1194 "ab45678\nab23456"), |
| 1203 Cmd("git log -1 --format=%s ab45678", "Title1"), | 1195 Cmd("git log -1 --format=%s ab45678", "Title1"), |
| 1204 Cmd("git log -1 --format=%s ab23456", "Title2"), | 1196 Cmd("git log -1 --format=%s ab23456", "Title2"), |
| 1205 Cmd(("git log --format=%H --grep=\"Port ab23456\" " | 1197 Cmd(("git log --format=%H --grep=\"^[P,p]ort ab23456\" " |
| 1206 "--reverse origin/master"), | 1198 "--reverse origin/master"), |
| 1207 ""), | 1199 ""), |
| 1208 Cmd(("git log --format=%H --grep=\"Port ab34567\" " | 1200 Cmd(("git log --format=%H --grep=\"^[P,p]ort ab34567\" " |
| 1209 "--reverse origin/master"), | 1201 "--reverse origin/master"), |
| 1210 "ab56789"), | 1202 "ab56789"), |
| 1211 Cmd("git log -1 --format=%s ab56789", "Title3"), | 1203 Cmd("git log -1 --format=%s ab56789", "Title3"), |
| 1212 RL("Y"), # Automatically add corresponding ports (ab34567, ab56789)? | 1204 RL("Y"), # Automatically add corresponding ports (ab34567, ab56789)? |
| 1213 # Simulate git being down which stops the script. | 1205 # Simulate git being down which stops the script. |
| 1214 Cmd("git log -1 --format=%s ab12345", None), | 1206 Cmd("git log -1 --format=%s ab12345", None), |
| 1215 # Restart script in the failing step. | 1207 # Restart script in the failing step. |
| 1216 Cmd("git log -1 --format=%s ab12345", "Title4"), | 1208 Cmd("git log -1 --format=%s ab12345", "Title4"), |
| 1217 Cmd("git log -1 --format=%s ab23456", "Title2"), | 1209 Cmd("git log -1 --format=%s ab23456", "Title2"), |
| 1218 Cmd("git log -1 --format=%s ab34567", "Title3"), | 1210 Cmd("git log -1 --format=%s ab34567", "Title3"), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1237 "", cb=VerifyPatch("patch3")), | 1229 "", cb=VerifyPatch("patch3")), |
| 1238 Cmd("git log -1 -p ab45678", "patch1"), | 1230 Cmd("git log -1 -p ab45678", "patch1"), |
| 1239 Cmd(("git apply --index --reject \"%s\"" % | 1231 Cmd(("git apply --index --reject \"%s\"" % |
| 1240 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), | 1232 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1241 "", cb=VerifyPatch("patch1")), | 1233 "", cb=VerifyPatch("patch1")), |
| 1242 Cmd("git log -1 -p ab56789", "patch5\n"), | 1234 Cmd("git log -1 -p ab56789", "patch5\n"), |
| 1243 Cmd(("git apply --index --reject \"%s\"" % | 1235 Cmd(("git apply --index --reject \"%s\"" % |
| 1244 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), | 1236 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1245 "", cb=VerifyPatch("patch5\n")), | 1237 "", cb=VerifyPatch("patch5\n")), |
| 1246 Cmd("git apply --index --reject \"%s\"" % extra_patch, ""), | 1238 Cmd("git apply --index --reject \"%s\"" % extra_patch, ""), |
| 1247 RL("Y"), # Automatically increment patch level? | |
| 1248 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""), | 1239 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""), |
| 1249 RL("reviewer@chromium.org"), # V8 reviewer. | 1240 RL("reviewer@chromium.org"), # V8 reviewer. |
| 1250 Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" " | 1241 Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" " |
| 1251 "--bypass-hooks --cc \"ulan@chromium.org\"", ""), | 1242 "--bypass-hooks --cc \"ulan@chromium.org\"", ""), |
| 1252 Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""), | 1243 Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1253 RL("LGTM"), # Enter LGTM for V8 CL. | 1244 RL("LGTM"), # Enter LGTM for V8 CL. |
| 1254 Cmd("git cl presubmit", "Presubmit successfull\n"), | 1245 Cmd("git cl presubmit", "Presubmit successfull\n"), |
| 1255 Cmd("git cl land -f --bypass-hooks", "Closing issue\n", | 1246 Cmd("git cl land -f --bypass-hooks", "Closing issue\n", |
| 1256 cb=VerifyLand), | 1247 cb=VerifyLand), |
| 1257 Cmd("git fetch", ""), | |
| 1258 Cmd("git log -1 --format=%H --grep=\"" | |
| 1259 "Version 3.22.5.1 (cherry-pick)" | |
| 1260 "\" refs/remotes/origin/candidates", | |
| 1261 ""), | |
| 1262 Cmd("git fetch", ""), | |
| 1263 Cmd("git log -1 --format=%H --grep=\"" | |
| 1264 "Version 3.22.5.1 (cherry-pick)" | |
| 1265 "\" refs/remotes/origin/candidates", | |
| 1266 "hsh_to_tag"), | |
| 1267 Cmd("git tag 3.22.5.1 hsh_to_tag", ""), | |
| 1268 Cmd("git push origin 3.22.5.1", ""), | |
| 1269 Cmd("git checkout -f origin/master", ""), | 1248 Cmd("git checkout -f origin/master", ""), |
| 1270 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), | 1249 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1271 ]) | 1250 ]) |
| 1272 | 1251 |
| 1273 # ab12345 and ab34567 are patches. ab23456 (included) and ab45678 are the | 1252 # ab12345 and ab34567 are patches. ab23456 (included) and ab45678 are the |
| 1274 # MIPS ports of ab12345. ab56789 is the MIPS port of ab34567. | 1253 # MIPS ports of ab12345. ab56789 is the MIPS port of ab34567. |
| 1275 args = ["-f", "-p", extra_patch, "--branch", "candidates", | 1254 args = ["-f", "-p", extra_patch, "--branch", "candidates", |
| 1276 "ab12345", "ab23456", "ab34567"] | 1255 "ab12345", "ab23456", "ab34567"] |
| 1277 | 1256 |
| 1278 # The first run of the script stops because of git being down. | 1257 # The first run of the script stops because of git being down. |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 | 1525 |
| 1547 Review URL: https://codereview.chromium.org/83173002 | 1526 Review URL: https://codereview.chromium.org/83173002 |
| 1548 | 1527 |
| 1549 ------------------------------------------------------------------------""") | 1528 ------------------------------------------------------------------------""") |
| 1550 self.assertEquals( | 1529 self.assertEquals( |
| 1551 """Prepare push to trunk. Now working on version 3.23.11. | 1530 """Prepare push to trunk. Now working on version 3.23.11. |
| 1552 | 1531 |
| 1553 R=danno@chromium.org | 1532 R=danno@chromium.org |
| 1554 | 1533 |
| 1555 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1534 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
| OLD | NEW |