| 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 16 matching lines...) Expand all Loading... |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import os | 29 import os |
| 30 import shutil | 30 import shutil |
| 31 import tempfile | 31 import tempfile |
| 32 import traceback | 32 import traceback |
| 33 import unittest | 33 import unittest |
| 34 | 34 |
| 35 import auto_push | 35 import auto_push |
| 36 from auto_push import CheckLastPush | 36 from auto_push import CheckLastPush |
| 37 from auto_push import SETTINGS_LOCATION | |
| 38 import auto_roll | 37 import auto_roll |
| 39 from auto_roll import CLUSTERFUZZ_API_KEY_FILE | |
| 40 import common_includes | 38 import common_includes |
| 41 from common_includes import * | 39 from common_includes import * |
| 42 import merge_to_branch | 40 import merge_to_branch |
| 43 from merge_to_branch import * | 41 from merge_to_branch import * |
| 44 import push_to_trunk | 42 import push_to_trunk |
| 45 from push_to_trunk import * | 43 from push_to_trunk import * |
| 46 import chromium_roll | 44 import chromium_roll |
| 47 from chromium_roll import CHROMIUM | |
| 48 from chromium_roll import ChromiumRoll | 45 from chromium_roll import ChromiumRoll |
| 49 import releases | 46 import releases |
| 50 from releases import Releases | 47 from releases import Releases |
| 51 import bump_up_version | 48 import bump_up_version |
| 52 from bump_up_version import BumpUpVersion | 49 from bump_up_version import BumpUpVersion |
| 53 from bump_up_version import LastChangeBailout | 50 from bump_up_version import LastChangeBailout |
| 54 from bump_up_version import LKGRVersionUpToDateBailout | 51 from bump_up_version import LKGRVersionUpToDateBailout |
| 55 from auto_tag import AutoTag | 52 from auto_tag import AutoTag |
| 56 | 53 |
| 57 | 54 |
| 58 TEST_CONFIG = { | 55 TEST_CONFIG = { |
| 59 "DEFAULT_CWD": None, | 56 "DEFAULT_CWD": None, |
| 60 BRANCHNAME: "test-prepare-push", | 57 "BRANCHNAME": "test-prepare-push", |
| 61 TRUNKBRANCH: "test-trunk-push", | 58 "TRUNKBRANCH": "test-trunk-push", |
| 62 PERSISTFILE_BASENAME: "/tmp/test-v8-push-to-trunk-tempfile", | 59 "PERSISTFILE_BASENAME": "/tmp/test-v8-push-to-trunk-tempfile", |
| 63 CHANGELOG_FILE: None, | 60 "CHANGELOG_FILE": None, |
| 64 CHANGELOG_ENTRY_FILE: "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry", | 61 "CHANGELOG_ENTRY_FILE": "/tmp/test-v8-push-to-trunk-tempfile-changelog-entry", |
| 65 PATCH_FILE: "/tmp/test-v8-push-to-trunk-tempfile-patch", | 62 "PATCH_FILE": "/tmp/test-v8-push-to-trunk-tempfile-patch", |
| 66 COMMITMSG_FILE: "/tmp/test-v8-push-to-trunk-tempfile-commitmsg", | 63 "COMMITMSG_FILE": "/tmp/test-v8-push-to-trunk-tempfile-commitmsg", |
| 67 CHROMIUM: "/tmp/test-v8-push-to-trunk-tempfile-chromium", | 64 "CHROMIUM": "/tmp/test-v8-push-to-trunk-tempfile-chromium", |
| 68 SETTINGS_LOCATION: None, | 65 "SETTINGS_LOCATION": None, |
| 69 ALREADY_MERGING_SENTINEL_FILE: | 66 "ALREADY_MERGING_SENTINEL_FILE": |
| 70 "/tmp/test-merge-to-branch-tempfile-already-merging", | 67 "/tmp/test-merge-to-branch-tempfile-already-merging", |
| 71 COMMIT_HASHES_FILE: "/tmp/test-merge-to-branch-tempfile-PATCH_COMMIT_HASHES", | 68 "TEMPORARY_PATCH_FILE": "/tmp/test-merge-to-branch-tempfile-temporary-patch", |
| 72 TEMPORARY_PATCH_FILE: "/tmp/test-merge-to-branch-tempfile-temporary-patch", | 69 "CLUSTERFUZZ_API_KEY_FILE": "/tmp/test-fake-cf-api-key", |
| 73 CLUSTERFUZZ_API_KEY_FILE: "/tmp/test-fake-cf-api-key", | |
| 74 } | 70 } |
| 75 | 71 |
| 76 | 72 |
| 77 AUTO_PUSH_ARGS = [ | 73 AUTO_PUSH_ARGS = [ |
| 78 "-a", "author@chromium.org", | 74 "-a", "author@chromium.org", |
| 79 "-r", "reviewer@chromium.org", | 75 "-r", "reviewer@chromium.org", |
| 80 ] | 76 ] |
| 81 | 77 |
| 82 | 78 |
| 83 class ToplevelTest(unittest.TestCase): | 79 class ToplevelTest(unittest.TestCase): |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 """Convenience wrapper.""" | 417 """Convenience wrapper.""" |
| 422 self._mock.Expect(*args) | 418 self._mock.Expect(*args) |
| 423 | 419 |
| 424 def setUp(self): | 420 def setUp(self): |
| 425 self._mock = SimpleMock() | 421 self._mock = SimpleMock() |
| 426 self._tmp_files = [] | 422 self._tmp_files = [] |
| 427 self._state = {} | 423 self._state = {} |
| 428 TEST_CONFIG["DEFAULT_CWD"] = self.MakeEmptyTempDirectory() | 424 TEST_CONFIG["DEFAULT_CWD"] = self.MakeEmptyTempDirectory() |
| 429 | 425 |
| 430 def tearDown(self): | 426 def tearDown(self): |
| 431 if os.path.exists(TEST_CONFIG[PERSISTFILE_BASENAME]): | 427 if os.path.exists(TEST_CONFIG["PERSISTFILE_BASENAME"]): |
| 432 shutil.rmtree(TEST_CONFIG[PERSISTFILE_BASENAME]) | 428 shutil.rmtree(TEST_CONFIG["PERSISTFILE_BASENAME"]) |
| 433 | 429 |
| 434 # Clean up temps. Doesn't work automatically. | 430 # Clean up temps. Doesn't work automatically. |
| 435 for name in self._tmp_files: | 431 for name in self._tmp_files: |
| 436 if os.path.isfile(name): | 432 if os.path.isfile(name): |
| 437 os.remove(name) | 433 os.remove(name) |
| 438 if os.path.isdir(name): | 434 if os.path.isdir(name): |
| 439 shutil.rmtree(name) | 435 shutil.rmtree(name) |
| 440 | 436 |
| 441 self._mock.AssertFinished() | 437 self._mock.AssertFinished() |
| 442 | 438 |
| 443 def testGitMock(self): | 439 def testGitMock(self): |
| 444 self.Expect([Cmd("git --version", "git version 1.2.3"), | 440 self.Expect([Cmd("git --version", "git version 1.2.3"), |
| 445 Cmd("git dummy", "")]) | 441 Cmd("git dummy", "")]) |
| 446 self.assertEquals("git version 1.2.3", self.MakeStep().Git("--version")) | 442 self.assertEquals("git version 1.2.3", self.MakeStep().Git("--version")) |
| 447 self.assertEquals("", self.MakeStep().Git("dummy")) | 443 self.assertEquals("", self.MakeStep().Git("dummy")) |
| 448 | 444 |
| 449 def testCommonPrepareDefault(self): | 445 def testCommonPrepareDefault(self): |
| 450 self.Expect([ | 446 self.Expect([ |
| 451 Cmd("git status -s -uno", ""), | 447 Cmd("git status -s -uno", ""), |
| 452 Cmd("git status -s -b -uno", "## some_branch"), | 448 Cmd("git status -s -b -uno", "## some_branch"), |
| 453 Cmd("git svn fetch", ""), | 449 Cmd("git svn fetch", ""), |
| 454 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]), | 450 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]), |
| 455 RL("Y"), | 451 RL("Y"), |
| 456 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 452 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 457 ]) | 453 ]) |
| 458 self.MakeStep().CommonPrepare() | 454 self.MakeStep().CommonPrepare() |
| 459 self.MakeStep().PrepareBranch() | 455 self.MakeStep().PrepareBranch() |
| 460 self.assertEquals("some_branch", self._state["current_branch"]) | 456 self.assertEquals("some_branch", self._state["current_branch"]) |
| 461 | 457 |
| 462 def testCommonPrepareNoConfirm(self): | 458 def testCommonPrepareNoConfirm(self): |
| 463 self.Expect([ | 459 self.Expect([ |
| 464 Cmd("git status -s -uno", ""), | 460 Cmd("git status -s -uno", ""), |
| 465 Cmd("git status -s -b -uno", "## some_branch"), | 461 Cmd("git status -s -b -uno", "## some_branch"), |
| 466 Cmd("git svn fetch", ""), | 462 Cmd("git svn fetch", ""), |
| 467 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]), | 463 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]), |
| 468 RL("n"), | 464 RL("n"), |
| 469 ]) | 465 ]) |
| 470 self.MakeStep().CommonPrepare() | 466 self.MakeStep().CommonPrepare() |
| 471 self.assertRaises(Exception, self.MakeStep().PrepareBranch) | 467 self.assertRaises(Exception, self.MakeStep().PrepareBranch) |
| 472 self.assertEquals("some_branch", self._state["current_branch"]) | 468 self.assertEquals("some_branch", self._state["current_branch"]) |
| 473 | 469 |
| 474 def testCommonPrepareDeleteBranchFailure(self): | 470 def testCommonPrepareDeleteBranchFailure(self): |
| 475 self.Expect([ | 471 self.Expect([ |
| 476 Cmd("git status -s -uno", ""), | 472 Cmd("git status -s -uno", ""), |
| 477 Cmd("git status -s -b -uno", "## some_branch"), | 473 Cmd("git status -s -b -uno", "## some_branch"), |
| 478 Cmd("git svn fetch", ""), | 474 Cmd("git svn fetch", ""), |
| 479 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG[BRANCHNAME]), | 475 Cmd("git branch", " branch1\n* %s" % TEST_CONFIG["BRANCHNAME"]), |
| 480 RL("Y"), | 476 RL("Y"), |
| 481 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], None), | 477 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], None), |
| 482 ]) | 478 ]) |
| 483 self.MakeStep().CommonPrepare() | 479 self.MakeStep().CommonPrepare() |
| 484 self.assertRaises(Exception, self.MakeStep().PrepareBranch) | 480 self.assertRaises(Exception, self.MakeStep().PrepareBranch) |
| 485 self.assertEquals("some_branch", self._state["current_branch"]) | 481 self.assertEquals("some_branch", self._state["current_branch"]) |
| 486 | 482 |
| 487 def testInitialEnvironmentChecks(self): | 483 def testInitialEnvironmentChecks(self): |
| 488 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 484 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 489 os.environ["EDITOR"] = "vi" | 485 os.environ["EDITOR"] = "vi" |
| 490 self.Expect([ | 486 self.Expect([ |
| 491 Cmd("which vi", "/usr/bin/vi"), | 487 Cmd("which vi", "/usr/bin/vi"), |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 # Tests the default push hash used when the --revision option is not set. | 522 # Tests the default push hash used when the --revision option is not set. |
| 527 self.Expect([ | 523 self.Expect([ |
| 528 Cmd("git log -1 --format=%H HEAD", "push_hash") | 524 Cmd("git log -1 --format=%H HEAD", "push_hash") |
| 529 ]) | 525 ]) |
| 530 | 526 |
| 531 self.RunStep(PushToTrunk, PreparePushRevision) | 527 self.RunStep(PushToTrunk, PreparePushRevision) |
| 532 self.assertEquals("push_hash", self._state["push_hash"]) | 528 self.assertEquals("push_hash", self._state["push_hash"]) |
| 533 | 529 |
| 534 def testPrepareChangeLog(self): | 530 def testPrepareChangeLog(self): |
| 535 self.WriteFakeVersionFile() | 531 self.WriteFakeVersionFile() |
| 536 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() | 532 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() |
| 537 | 533 |
| 538 self.Expect([ | 534 self.Expect([ |
| 539 Cmd("git log --format=%H 1234..push_hash", "rev1\nrev2\nrev3\nrev4"), | 535 Cmd("git log --format=%H 1234..push_hash", "rev1\nrev2\nrev3\nrev4"), |
| 540 Cmd("git log -1 --format=%s rev1", "Title text 1"), | 536 Cmd("git log -1 --format=%s rev1", "Title text 1"), |
| 541 Cmd("git log -1 --format=%B rev1", "Title\n\nBUG=\nLOG=y\n"), | 537 Cmd("git log -1 --format=%B rev1", "Title\n\nBUG=\nLOG=y\n"), |
| 542 Cmd("git log -1 --format=%an rev1", "author1@chromium.org"), | 538 Cmd("git log -1 --format=%an rev1", "author1@chromium.org"), |
| 543 Cmd("git log -1 --format=%s rev2", "Title text 2."), | 539 Cmd("git log -1 --format=%s rev2", "Title text 2."), |
| 544 Cmd("git log -1 --format=%B rev2", "Title\n\nBUG=123\nLOG= \n"), | 540 Cmd("git log -1 --format=%B rev2", "Title\n\nBUG=123\nLOG= \n"), |
| 545 Cmd("git log -1 --format=%an rev2", "author2@chromium.org"), | 541 Cmd("git log -1 --format=%an rev2", "author2@chromium.org"), |
| 546 Cmd("git log -1 --format=%s rev3", "Title text 3"), | 542 Cmd("git log -1 --format=%s rev3", "Title text 3"), |
| 547 Cmd("git log -1 --format=%B rev3", "Title\n\nBUG=321\nLOG=true\n"), | 543 Cmd("git log -1 --format=%B rev3", "Title\n\nBUG=321\nLOG=true\n"), |
| 548 Cmd("git log -1 --format=%an rev3", "author3@chromium.org"), | 544 Cmd("git log -1 --format=%an rev3", "author3@chromium.org"), |
| 549 Cmd("git log -1 --format=%s rev4", "Title text 4"), | 545 Cmd("git log -1 --format=%s rev4", "Title text 4"), |
| 550 Cmd("git log -1 --format=%B rev4", | 546 Cmd("git log -1 --format=%B rev4", |
| 551 ("Title\n\nBUG=456\nLOG=Y\n\n" | 547 ("Title\n\nBUG=456\nLOG=Y\n\n" |
| 552 "Review URL: https://codereview.chromium.org/9876543210\n")), | 548 "Review URL: https://codereview.chromium.org/9876543210\n")), |
| 553 URL("https://codereview.chromium.org/9876543210/description", | 549 URL("https://codereview.chromium.org/9876543210/description", |
| 554 "Title\n\nBUG=456\nLOG=N\n\n"), | 550 "Title\n\nBUG=456\nLOG=N\n\n"), |
| 555 Cmd("git log -1 --format=%an rev4", "author4@chromium.org"), | 551 Cmd("git log -1 --format=%an rev4", "author4@chromium.org"), |
| 556 ]) | 552 ]) |
| 557 | 553 |
| 558 self._state["last_push_bleeding_edge"] = "1234" | 554 self._state["last_push_bleeding_edge"] = "1234" |
| 559 self._state["push_hash"] = "push_hash" | 555 self._state["push_hash"] = "push_hash" |
| 560 self._state["version"] = "3.22.5" | 556 self._state["version"] = "3.22.5" |
| 561 self.RunStep(PushToTrunk, PrepareChangeLog) | 557 self.RunStep(PushToTrunk, PrepareChangeLog) |
| 562 | 558 |
| 563 actual_cl = FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE]) | 559 actual_cl = FileToText(TEST_CONFIG["CHANGELOG_ENTRY_FILE"]) |
| 564 | 560 |
| 565 expected_cl = """1999-07-31: Version 3.22.5 | 561 expected_cl = """1999-07-31: Version 3.22.5 |
| 566 | 562 |
| 567 Title text 1. | 563 Title text 1. |
| 568 | 564 |
| 569 Title text 3 (Chromium issue 321). | 565 Title text 3 (Chromium issue 321). |
| 570 | 566 |
| 571 Performance and stability improvements on all platforms. | 567 Performance and stability improvements on all platforms. |
| 572 # | 568 # |
| 573 # The change log above is auto-generated. Please review if all relevant | 569 # The change log above is auto-generated. Please review if all relevant |
| (...skipping 10 matching lines...) Expand all Loading... |
| 584 # (author3@chromium.org) | 580 # (author3@chromium.org) |
| 585 # | 581 # |
| 586 # Title text 4 (Chromium issue 456). | 582 # Title text 4 (Chromium issue 456). |
| 587 # (author4@chromium.org) | 583 # (author4@chromium.org) |
| 588 # | 584 # |
| 589 #""" | 585 #""" |
| 590 | 586 |
| 591 self.assertEquals(expected_cl, actual_cl) | 587 self.assertEquals(expected_cl, actual_cl) |
| 592 | 588 |
| 593 def testEditChangeLog(self): | 589 def testEditChangeLog(self): |
| 594 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() | 590 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() |
| 595 TextToFile(" New \n\tLines \n", TEST_CONFIG[CHANGELOG_ENTRY_FILE]) | 591 TextToFile(" New \n\tLines \n", TEST_CONFIG["CHANGELOG_ENTRY_FILE"]) |
| 596 os.environ["EDITOR"] = "vi" | 592 os.environ["EDITOR"] = "vi" |
| 597 self.Expect([ | 593 self.Expect([ |
| 598 RL(""), # Open editor. | 594 RL(""), # Open editor. |
| 599 Cmd("vi %s" % TEST_CONFIG[CHANGELOG_ENTRY_FILE], ""), | 595 Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], ""), |
| 600 ]) | 596 ]) |
| 601 | 597 |
| 602 self.RunStep(PushToTrunk, EditChangeLog) | 598 self.RunStep(PushToTrunk, EditChangeLog) |
| 603 | 599 |
| 604 self.assertEquals("New\n Lines", | 600 self.assertEquals("New\n Lines", |
| 605 FileToText(TEST_CONFIG[CHANGELOG_ENTRY_FILE])) | 601 FileToText(TEST_CONFIG["CHANGELOG_ENTRY_FILE"])) |
| 606 | 602 |
| 607 # Version on trunk: 3.22.4.0. Version on master (bleeding_edge): 3.22.6. | 603 # Version on trunk: 3.22.4.0. Version on master (bleeding_edge): 3.22.6. |
| 608 # Make sure that the increment is 3.22.7.0. | 604 # Make sure that the increment is 3.22.7.0. |
| 609 def testIncrementVersion(self): | 605 def testIncrementVersion(self): |
| 610 self.WriteFakeVersionFile() | 606 self.WriteFakeVersionFile() |
| 611 self._state["last_push_trunk"] = "hash1" | 607 self._state["last_push_trunk"] = "hash1" |
| 612 self._state["latest_build"] = "6" | 608 self._state["latest_build"] = "6" |
| 613 self._state["latest_version"] = "3.22.6.0" | 609 self._state["latest_version"] = "3.22.6.0" |
| 614 | 610 |
| 615 self.Expect([ | 611 self.Expect([ |
| 616 Cmd("git checkout -f hash1 -- src/version.cc", ""), | 612 Cmd("git checkout -f hash1 -- src/version.cc", ""), |
| 617 Cmd("git checkout -f svn/bleeding_edge -- src/version.cc", | 613 Cmd("git checkout -f svn/bleeding_edge -- src/version.cc", |
| 618 "", cb=lambda: self.WriteFakeVersionFile(22, 6)), | 614 "", cb=lambda: self.WriteFakeVersionFile(22, 6)), |
| 619 RL("Y"), # Increment build number. | 615 RL("Y"), # Increment build number. |
| 620 ]) | 616 ]) |
| 621 | 617 |
| 622 self.RunStep(PushToTrunk, IncrementVersion) | 618 self.RunStep(PushToTrunk, IncrementVersion) |
| 623 | 619 |
| 624 self.assertEquals("3", self._state["new_major"]) | 620 self.assertEquals("3", self._state["new_major"]) |
| 625 self.assertEquals("22", self._state["new_minor"]) | 621 self.assertEquals("22", self._state["new_minor"]) |
| 626 self.assertEquals("7", self._state["new_build"]) | 622 self.assertEquals("7", self._state["new_build"]) |
| 627 self.assertEquals("0", self._state["new_patch"]) | 623 self.assertEquals("0", self._state["new_patch"]) |
| 628 | 624 |
| 629 def _TestSquashCommits(self, change_log, expected_msg): | 625 def _TestSquashCommits(self, change_log, expected_msg): |
| 630 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() | 626 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() |
| 631 with open(TEST_CONFIG[CHANGELOG_ENTRY_FILE], "w") as f: | 627 with open(TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "w") as f: |
| 632 f.write(change_log) | 628 f.write(change_log) |
| 633 | 629 |
| 634 self.Expect([ | 630 self.Expect([ |
| 635 Cmd("git diff svn/trunk hash1", "patch content"), | 631 Cmd("git diff svn/trunk hash1", "patch content"), |
| 636 Cmd("git svn find-rev hash1", "123455\n"), | 632 Cmd("git svn find-rev hash1", "123455\n"), |
| 637 ]) | 633 ]) |
| 638 | 634 |
| 639 self._state["push_hash"] = "hash1" | 635 self._state["push_hash"] = "hash1" |
| 640 self._state["date"] = "1999-11-11" | 636 self._state["date"] = "1999-11-11" |
| 641 | 637 |
| 642 self.RunStep(PushToTrunk, SquashCommits) | 638 self.RunStep(PushToTrunk, SquashCommits) |
| 643 self.assertEquals(FileToText(TEST_CONFIG[COMMITMSG_FILE]), expected_msg) | 639 self.assertEquals(FileToText(TEST_CONFIG["COMMITMSG_FILE"]), expected_msg) |
| 644 | 640 |
| 645 patch = FileToText(TEST_CONFIG[ PATCH_FILE]) | 641 patch = FileToText(TEST_CONFIG["PATCH_FILE"]) |
| 646 self.assertTrue(re.search(r"patch content", patch)) | 642 self.assertTrue(re.search(r"patch content", patch)) |
| 647 | 643 |
| 648 def testSquashCommitsUnformatted(self): | 644 def testSquashCommitsUnformatted(self): |
| 649 change_log = """1999-11-11: Version 3.22.5 | 645 change_log = """1999-11-11: Version 3.22.5 |
| 650 | 646 |
| 651 Log text 1. | 647 Log text 1. |
| 652 Chromium issue 12345 | 648 Chromium issue 12345 |
| 653 | 649 |
| 654 Performance and stability improvements on all platforms.\n""" | 650 Performance and stability improvements on all platforms.\n""" |
| 655 commit_msg = """Version 3.22.5 (based on bleeding_edge revision r123455) | 651 commit_msg = """Version 3.22.5 (based on bleeding_edge revision r123455) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 678 commit_msg = """Line with "quotation marks".""" | 674 commit_msg = """Line with "quotation marks".""" |
| 679 self._TestSquashCommits(change_log, commit_msg) | 675 self._TestSquashCommits(change_log, commit_msg) |
| 680 | 676 |
| 681 def _PushToTrunk(self, force=False, manual=False): | 677 def _PushToTrunk(self, force=False, manual=False): |
| 682 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 678 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 683 | 679 |
| 684 # The version file on bleeding edge has build level 5, while the version | 680 # The version file on bleeding edge has build level 5, while the version |
| 685 # file from trunk has build level 4. | 681 # file from trunk has build level 4. |
| 686 self.WriteFakeVersionFile(build=5) | 682 self.WriteFakeVersionFile(build=5) |
| 687 | 683 |
| 688 TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() | 684 TEST_CONFIG["CHANGELOG_ENTRY_FILE"] = self.MakeEmptyTempFile() |
| 689 TEST_CONFIG[CHANGELOG_FILE] = self.MakeEmptyTempFile() | 685 TEST_CONFIG["CHANGELOG_FILE"] = self.MakeEmptyTempFile() |
| 690 bleeding_edge_change_log = "2014-03-17: Sentinel\n" | 686 bleeding_edge_change_log = "2014-03-17: Sentinel\n" |
| 691 TextToFile(bleeding_edge_change_log, TEST_CONFIG[CHANGELOG_FILE]) | 687 TextToFile(bleeding_edge_change_log, TEST_CONFIG["CHANGELOG_FILE"]) |
| 692 os.environ["EDITOR"] = "vi" | 688 os.environ["EDITOR"] = "vi" |
| 693 | 689 |
| 694 def ResetChangeLog(): | 690 def ResetChangeLog(): |
| 695 """On 'git co -b new_branch svn/trunk', and 'git checkout -- ChangeLog', | 691 """On 'git co -b new_branch svn/trunk', and 'git checkout -- ChangeLog', |
| 696 the ChangLog will be reset to its content on trunk.""" | 692 the ChangLog will be reset to its content on trunk.""" |
| 697 trunk_change_log = """1999-04-05: Version 3.22.4 | 693 trunk_change_log = """1999-04-05: Version 3.22.4 |
| 698 | 694 |
| 699 Performance and stability improvements on all platforms.\n""" | 695 Performance and stability improvements on all platforms.\n""" |
| 700 TextToFile(trunk_change_log, TEST_CONFIG[CHANGELOG_FILE]) | 696 TextToFile(trunk_change_log, TEST_CONFIG["CHANGELOG_FILE"]) |
| 701 | 697 |
| 702 def ResetToTrunk(): | 698 def ResetToTrunk(): |
| 703 ResetChangeLog() | 699 ResetChangeLog() |
| 704 self.WriteFakeVersionFile() | 700 self.WriteFakeVersionFile() |
| 705 | 701 |
| 706 def CheckSVNCommit(): | 702 def CheckSVNCommit(): |
| 707 commit = FileToText(TEST_CONFIG[COMMITMSG_FILE]) | 703 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
| 708 self.assertEquals( | 704 self.assertEquals( |
| 709 """Version 3.22.5 (based on bleeding_edge revision r123455) | 705 """Version 3.22.5 (based on bleeding_edge revision r123455) |
| 710 | 706 |
| 711 Log text 1 (issue 321). | 707 Log text 1 (issue 321). |
| 712 | 708 |
| 713 Performance and stability improvements on all platforms.""", commit) | 709 Performance and stability improvements on all platforms.""", commit) |
| 714 version = FileToText( | 710 version = FileToText( |
| 715 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) | 711 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) |
| 716 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) | 712 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) |
| 717 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) | 713 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) |
| 718 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version)) | 714 self.assertFalse(re.search(r"#define BUILD_NUMBER\s+6", version)) |
| 719 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version)) | 715 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version)) |
| 720 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) | 716 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) |
| 721 | 717 |
| 722 # Check that the change log on the trunk branch got correctly modified. | 718 # Check that the change log on the trunk branch got correctly modified. |
| 723 change_log = FileToText(TEST_CONFIG[CHANGELOG_FILE]) | 719 change_log = FileToText(TEST_CONFIG["CHANGELOG_FILE"]) |
| 724 self.assertEquals( | 720 self.assertEquals( |
| 725 """1999-07-31: Version 3.22.5 | 721 """1999-07-31: Version 3.22.5 |
| 726 | 722 |
| 727 Log text 1 (issue 321). | 723 Log text 1 (issue 321). |
| 728 | 724 |
| 729 Performance and stability improvements on all platforms. | 725 Performance and stability improvements on all platforms. |
| 730 | 726 |
| 731 | 727 |
| 732 1999-04-05: Version 3.22.4 | 728 1999-04-05: Version 3.22.4 |
| 733 | 729 |
| 734 Performance and stability improvements on all platforms.\n""", | 730 Performance and stability improvements on all platforms.\n""", |
| 735 change_log) | 731 change_log) |
| 736 | 732 |
| 737 force_flag = " -f" if not manual else "" | 733 force_flag = " -f" if not manual else "" |
| 738 expectations = [] | 734 expectations = [] |
| 739 if not force: | 735 if not force: |
| 740 expectations.append(Cmd("which vi", "/usr/bin/vi")) | 736 expectations.append(Cmd("which vi", "/usr/bin/vi")) |
| 741 expectations += [ | 737 expectations += [ |
| 742 Cmd("git status -s -uno", ""), | 738 Cmd("git status -s -uno", ""), |
| 743 Cmd("git status -s -b -uno", "## some_branch\n"), | 739 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 744 Cmd("git svn fetch", ""), | 740 Cmd("git svn fetch", ""), |
| 745 Cmd("git branch", " branch1\n* branch2\n"), | 741 Cmd("git branch", " branch1\n* branch2\n"), |
| 746 Cmd("git branch", " branch1\n* branch2\n"), | 742 Cmd("git branch", " branch1\n* branch2\n"), |
| 747 Cmd("git checkout -b %s svn/bleeding_edge" % TEST_CONFIG[BRANCHNAME], | 743 Cmd("git checkout -b %s svn/bleeding_edge" % TEST_CONFIG["BRANCHNAME"], |
| 748 ""), | 744 ""), |
| 749 Cmd("git svn find-rev r123455", "push_hash\n"), | 745 Cmd("git svn find-rev r123455", "push_hash\n"), |
| 750 Cmd(("git log -1 --format=%H --grep=" | 746 Cmd(("git log -1 --format=%H --grep=" |
| 751 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" " | 747 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\" " |
| 752 "svn/trunk"), "hash2\n"), | 748 "svn/trunk"), "hash2\n"), |
| 753 Cmd("git log -1 hash2", "Log message\n"), | 749 Cmd("git log -1 hash2", "Log message\n"), |
| 754 ] | 750 ] |
| 755 if manual: | 751 if manual: |
| 756 expectations.append(RL("Y")) # Confirm last push. | 752 expectations.append(RL("Y")) # Confirm last push. |
| 757 expectations += [ | 753 expectations += [ |
| 758 Cmd("git log -1 --format=%s hash2", | 754 Cmd("git log -1 --format=%s hash2", |
| 759 "Version 3.4.5 (based on bleeding_edge revision r1234)\n"), | 755 "Version 3.4.5 (based on bleeding_edge revision r1234)\n"), |
| 760 Cmd("git svn find-rev r1234", "hash3\n"), | 756 Cmd("git svn find-rev r1234", "hash3\n"), |
| 761 Cmd("git checkout -f svn/bleeding_edge -- src/version.cc", | 757 Cmd("git checkout -f svn/bleeding_edge -- src/version.cc", |
| 762 "", cb=self.WriteFakeVersionFile), | 758 "", cb=self.WriteFakeVersionFile), |
| 763 Cmd("git checkout -f hash2 -- src/version.cc", "", | 759 Cmd("git checkout -f hash2 -- src/version.cc", "", |
| 764 cb=self.WriteFakeVersionFile), | 760 cb=self.WriteFakeVersionFile), |
| 765 ] | 761 ] |
| 766 if manual: | 762 if manual: |
| 767 expectations.append(RL("")) # Increment build number. | 763 expectations.append(RL("")) # Increment build number. |
| 768 expectations += [ | 764 expectations += [ |
| 769 Cmd("git log --format=%H hash3..push_hash", "rev1\n"), | 765 Cmd("git log --format=%H hash3..push_hash", "rev1\n"), |
| 770 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), | 766 Cmd("git log -1 --format=%s rev1", "Log text 1.\n"), |
| 771 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"), | 767 Cmd("git log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"), |
| 772 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), | 768 Cmd("git log -1 --format=%an rev1", "author1@chromium.org\n"), |
| 773 ] | 769 ] |
| 774 if manual: | 770 if manual: |
| 775 expectations.append(RL("")) # Open editor. | 771 expectations.append(RL("")) # Open editor. |
| 776 if not force: | 772 if not force: |
| 777 expectations.append(Cmd("vi %s" % TEST_CONFIG[CHANGELOG_ENTRY_FILE], "")) | 773 expectations.append( |
| 774 Cmd("vi %s" % TEST_CONFIG["CHANGELOG_ENTRY_FILE"], "")) |
| 778 expectations += [ | 775 expectations += [ |
| 779 Cmd("git svn fetch", "fetch result\n"), | 776 Cmd("git svn fetch", "fetch result\n"), |
| 780 Cmd("git checkout -f svn/bleeding_edge", ""), | 777 Cmd("git checkout -f svn/bleeding_edge", ""), |
| 781 Cmd("git diff svn/trunk push_hash", "patch content\n"), | 778 Cmd("git diff svn/trunk push_hash", "patch content\n"), |
| 782 Cmd("git svn find-rev push_hash", "123455\n"), | 779 Cmd("git svn find-rev push_hash", "123455\n"), |
| 783 Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], "", | 780 Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG["TRUNKBRANCH"], "", |
| 784 cb=ResetToTrunk), | 781 cb=ResetToTrunk), |
| 785 Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""), | 782 Cmd("git apply --index --reject \"%s\"" % TEST_CONFIG["PATCH_FILE"], ""), |
| 786 Cmd("git checkout -f svn/trunk -- %s" % TEST_CONFIG[CHANGELOG_FILE], "", | 783 Cmd("git checkout -f svn/trunk -- %s" % TEST_CONFIG["CHANGELOG_FILE"], "", |
| 787 cb=ResetChangeLog), | 784 cb=ResetChangeLog), |
| 788 Cmd("git checkout -f svn/trunk -- src/version.cc", "", | 785 Cmd("git checkout -f svn/trunk -- src/version.cc", "", |
| 789 cb=self.WriteFakeVersionFile), | 786 cb=self.WriteFakeVersionFile), |
| 790 Cmd("git commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", | 787 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "", |
| 791 cb=CheckSVNCommit), | 788 cb=CheckSVNCommit), |
| 792 ] | 789 ] |
| 793 if manual: | 790 if manual: |
| 794 expectations.append(RL("Y")) # Sanity check. | 791 expectations.append(RL("Y")) # Sanity check. |
| 795 expectations += [ | 792 expectations += [ |
| 796 Cmd("git svn dcommit 2>&1", | 793 Cmd("git svn dcommit 2>&1", |
| 797 "Some output\nCommitted r123456\nSome output\n"), | 794 "Some output\nCommitted r123456\nSome output\n"), |
| 798 Cmd("git svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""), | 795 Cmd("git svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""), |
| 799 Cmd("git checkout -f some_branch", ""), | 796 Cmd("git checkout -f some_branch", ""), |
| 800 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 797 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 801 Cmd("git branch -D %s" % TEST_CONFIG[TRUNKBRANCH], ""), | 798 Cmd("git branch -D %s" % TEST_CONFIG["TRUNKBRANCH"], ""), |
| 802 ] | 799 ] |
| 803 self.Expect(expectations) | 800 self.Expect(expectations) |
| 804 | 801 |
| 805 args = ["-a", "author@chromium.org", "--revision", "123455"] | 802 args = ["-a", "author@chromium.org", "--revision", "123455"] |
| 806 if force: args.append("-f") | 803 if force: args.append("-f") |
| 807 if manual: args.append("-m") | 804 if manual: args.append("-m") |
| 808 else: args += ["-r", "reviewer@chromium.org"] | 805 else: args += ["-r", "reviewer@chromium.org"] |
| 809 PushToTrunk(TEST_CONFIG, self).Run(args) | 806 PushToTrunk(TEST_CONFIG, self).Run(args) |
| 810 | 807 |
| 811 cl = FileToText(TEST_CONFIG[CHANGELOG_FILE]) | 808 cl = FileToText(TEST_CONFIG["CHANGELOG_FILE"]) |
| 812 self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl)) | 809 self.assertTrue(re.search(r"^\d\d\d\d\-\d+\-\d+: Version 3\.22\.5", cl)) |
| 813 self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl)) | 810 self.assertTrue(re.search(r" Log text 1 \(issue 321\).", cl)) |
| 814 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl)) | 811 self.assertTrue(re.search(r"1999\-04\-05: Version 3\.22\.4", cl)) |
| 815 | 812 |
| 816 # Note: The version file is on build number 5 again in the end of this test | 813 # Note: The version file is on build number 5 again in the end of this test |
| 817 # since the git command that merges to the bleeding edge branch is mocked | 814 # since the git command that merges to the bleeding edge branch is mocked |
| 818 # out. | 815 # out. |
| 819 | 816 |
| 820 def testPushToTrunkManual(self): | 817 def testPushToTrunkManual(self): |
| 821 self._PushToTrunk(manual=True) | 818 self._PushToTrunk(manual=True) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 838 | 835 |
| 839 """ | 836 """ |
| 840 | 837 |
| 841 C_V8_123456_LOG = """V8 CL. | 838 C_V8_123456_LOG = """V8 CL. |
| 842 | 839 |
| 843 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 | 840 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123456 123 |
| 844 | 841 |
| 845 """ | 842 """ |
| 846 | 843 |
| 847 def testChromiumRoll(self): | 844 def testChromiumRoll(self): |
| 848 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG[PERSISTFILE_BASENAME] | 845 googlers_mapping_py = "%s-mapping.py" % TEST_CONFIG["PERSISTFILE_BASENAME"] |
| 849 with open(googlers_mapping_py, "w") as f: | 846 with open(googlers_mapping_py, "w") as f: |
| 850 f.write(""" | 847 f.write(""" |
| 851 def list_to_dict(entries): | 848 def list_to_dict(entries): |
| 852 return {"g_name@google.com": "c_name@chromium.org"} | 849 return {"g_name@google.com": "c_name@chromium.org"} |
| 853 def get_list(): | 850 def get_list(): |
| 854 pass""") | 851 pass""") |
| 855 | 852 |
| 856 # Setup fake directory structures. | 853 # Setup fake directory structures. |
| 857 TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory() | 854 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 858 TextToFile("", os.path.join(TEST_CONFIG[CHROMIUM], ".git")) | 855 TextToFile("", os.path.join(TEST_CONFIG["CHROMIUM"], ".git")) |
| 859 chrome_dir = TEST_CONFIG[CHROMIUM] | 856 chrome_dir = TEST_CONFIG["CHROMIUM"] |
| 860 os.makedirs(os.path.join(chrome_dir, "v8")) | 857 os.makedirs(os.path.join(chrome_dir, "v8")) |
| 861 | 858 |
| 862 # Write fake deps file. | 859 # Write fake deps file. |
| 863 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", | 860 TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", |
| 864 os.path.join(chrome_dir, "DEPS")) | 861 os.path.join(chrome_dir, "DEPS")) |
| 865 def WriteDeps(): | 862 def WriteDeps(): |
| 866 TextToFile("Some line\n \"v8_revision\": \"22624\",\n some line", | 863 TextToFile("Some line\n \"v8_revision\": \"22624\",\n some line", |
| 867 os.path.join(chrome_dir, "DEPS")) | 864 os.path.join(chrome_dir, "DEPS")) |
| 868 | 865 |
| 869 expectations = [ | 866 expectations = [ |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 ]) | 909 ]) |
| 913 | 910 |
| 914 self._state["lkgr"] = "101" | 911 self._state["lkgr"] = "101" |
| 915 | 912 |
| 916 self.assertRaises(Exception, lambda: self.RunStep(auto_push.AutoPush, | 913 self.assertRaises(Exception, lambda: self.RunStep(auto_push.AutoPush, |
| 917 CheckLastPush, | 914 CheckLastPush, |
| 918 AUTO_PUSH_ARGS)) | 915 AUTO_PUSH_ARGS)) |
| 919 | 916 |
| 920 def testAutoPush(self): | 917 def testAutoPush(self): |
| 921 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 918 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 922 TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist" | 919 TEST_CONFIG["SETTINGS_LOCATION"] = "~/.doesnotexist" |
| 923 | 920 |
| 924 self.Expect([ | 921 self.Expect([ |
| 925 Cmd("git status -s -uno", ""), | 922 Cmd("git status -s -uno", ""), |
| 926 Cmd("git status -s -b -uno", "## some_branch\n"), | 923 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 927 Cmd("git svn fetch", ""), | 924 Cmd("git svn fetch", ""), |
| 928 URL("https://v8-status.appspot.com/current?format=json", | 925 URL("https://v8-status.appspot.com/current?format=json", |
| 929 "{\"message\": \"Tree is throttled\"}"), | 926 "{\"message\": \"Tree is throttled\"}"), |
| 930 URL("https://v8-status.appspot.com/lkgr", Exception("Network problem")), | 927 URL("https://v8-status.appspot.com/lkgr", Exception("Network problem")), |
| 931 URL("https://v8-status.appspot.com/lkgr", "100"), | 928 URL("https://v8-status.appspot.com/lkgr", "100"), |
| 932 Cmd(("git log -1 --format=%H --grep=\"" | 929 Cmd(("git log -1 --format=%H --grep=\"" |
| 933 "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\"" | 930 "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]* (based\"" |
| 934 " svn/trunk"), "push_hash\n"), | 931 " svn/trunk"), "push_hash\n"), |
| 935 Cmd("git log -1 --format=%s push_hash", | 932 Cmd("git log -1 --format=%s push_hash", |
| 936 "Version 3.4.5 (based on bleeding_edge revision r79)\n"), | 933 "Version 3.4.5 (based on bleeding_edge revision r79)\n"), |
| 937 ]) | 934 ]) |
| 938 | 935 |
| 939 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) | 936 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS + ["--push"]) |
| 940 | 937 |
| 941 state = json.loads(FileToText("%s-state.json" | 938 state = json.loads(FileToText("%s-state.json" |
| 942 % TEST_CONFIG[PERSISTFILE_BASENAME])) | 939 % TEST_CONFIG["PERSISTFILE_BASENAME"])) |
| 943 | 940 |
| 944 self.assertEquals("100", state["lkgr"]) | 941 self.assertEquals("100", state["lkgr"]) |
| 945 | 942 |
| 946 def testAutoPushStoppedBySettings(self): | 943 def testAutoPushStoppedBySettings(self): |
| 947 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 944 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 948 TEST_CONFIG[SETTINGS_LOCATION] = self.MakeEmptyTempFile() | 945 TEST_CONFIG["SETTINGS_LOCATION"] = self.MakeEmptyTempFile() |
| 949 TextToFile("{\"enable_auto_push\": false}", TEST_CONFIG[SETTINGS_LOCATION]) | 946 TextToFile("{\"enable_auto_push\": false}", |
| 947 TEST_CONFIG["SETTINGS_LOCATION"]) |
| 950 | 948 |
| 951 self.Expect([ | 949 self.Expect([ |
| 952 Cmd("git status -s -uno", ""), | 950 Cmd("git status -s -uno", ""), |
| 953 Cmd("git status -s -b -uno", "## some_branch\n"), | 951 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 954 Cmd("git svn fetch", ""), | 952 Cmd("git svn fetch", ""), |
| 955 ]) | 953 ]) |
| 956 | 954 |
| 957 def RunAutoPush(): | 955 def RunAutoPush(): |
| 958 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS) | 956 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS) |
| 959 self.assertRaises(Exception, RunAutoPush) | 957 self.assertRaises(Exception, RunAutoPush) |
| 960 | 958 |
| 961 def testAutoPushStoppedByTreeStatus(self): | 959 def testAutoPushStoppedByTreeStatus(self): |
| 962 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 960 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 963 TEST_CONFIG[SETTINGS_LOCATION] = "~/.doesnotexist" | 961 TEST_CONFIG["SETTINGS_LOCATION"] = "~/.doesnotexist" |
| 964 | 962 |
| 965 self.Expect([ | 963 self.Expect([ |
| 966 Cmd("git status -s -uno", ""), | 964 Cmd("git status -s -uno", ""), |
| 967 Cmd("git status -s -b -uno", "## some_branch\n"), | 965 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 968 Cmd("git svn fetch", ""), | 966 Cmd("git svn fetch", ""), |
| 969 URL("https://v8-status.appspot.com/current?format=json", | 967 URL("https://v8-status.appspot.com/current?format=json", |
| 970 "{\"message\": \"Tree is throttled (no push)\"}"), | 968 "{\"message\": \"Tree is throttled (no push)\"}"), |
| 971 ]) | 969 ]) |
| 972 | 970 |
| 973 def RunAutoPush(): | 971 def RunAutoPush(): |
| 974 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS) | 972 auto_push.AutoPush(TEST_CONFIG, self).Run(AUTO_PUSH_ARGS) |
| 975 self.assertRaises(Exception, RunAutoPush) | 973 self.assertRaises(Exception, RunAutoPush) |
| 976 | 974 |
| 977 def testAutoRollExistingRoll(self): | 975 def testAutoRollExistingRoll(self): |
| 978 self.Expect([ | 976 self.Expect([ |
| 979 URL("https://codereview.chromium.org/search", | 977 URL("https://codereview.chromium.org/search", |
| 980 "owner=author%40chromium.org&limit=30&closed=3&format=json", | 978 "owner=author%40chromium.org&limit=30&closed=3&format=json", |
| 981 ("{\"results\": [{\"subject\": \"different\"}," | 979 ("{\"results\": [{\"subject\": \"different\"}," |
| 982 "{\"subject\": \"Update V8 to Version...\"}]}")), | 980 "{\"subject\": \"Update V8 to Version...\"}]}")), |
| 983 ]) | 981 ]) |
| 984 | 982 |
| 985 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 983 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
| 986 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) | 984 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]]) |
| 987 self.assertEquals(0, result) | 985 self.assertEquals(0, result) |
| 988 | 986 |
| 989 # Snippet from the original DEPS file. | 987 # Snippet from the original DEPS file. |
| 990 FAKE_DEPS = """ | 988 FAKE_DEPS = """ |
| 991 vars = { | 989 vars = { |
| 992 "v8_revision": "abcd123455", | 990 "v8_revision": "abcd123455", |
| 993 } | 991 } |
| 994 deps = { | 992 deps = { |
| 995 "src/v8": | 993 "src/v8": |
| 996 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + | 994 (Var("googlecode_url") % "v8") + "/" + Var("v8_branch") + "@" + |
| 997 Var("v8_revision"), | 995 Var("v8_revision"), |
| 998 } | 996 } |
| 999 """ | 997 """ |
| 1000 | 998 |
| 1001 def testAutoRollUpToDate(self): | 999 def testAutoRollUpToDate(self): |
| 1002 TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory() | 1000 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 1003 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS")) | 1001 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) |
| 1004 self.Expect([ | 1002 self.Expect([ |
| 1005 URL("https://codereview.chromium.org/search", | 1003 URL("https://codereview.chromium.org/search", |
| 1006 "owner=author%40chromium.org&limit=30&closed=3&format=json", | 1004 "owner=author%40chromium.org&limit=30&closed=3&format=json", |
| 1007 ("{\"results\": [{\"subject\": \"different\"}]}")), | 1005 ("{\"results\": [{\"subject\": \"different\"}]}")), |
| 1008 Cmd(("git log -1 --format=%H --grep=" | 1006 Cmd(("git log -1 --format=%H --grep=" |
| 1009 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 1007 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
| 1010 "origin/master"), "push_hash\n"), | 1008 "origin/master"), "push_hash\n"), |
| 1011 Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG), | 1009 Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG), |
| 1012 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), | 1010 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), |
| 1013 ]) | 1011 ]) |
| 1014 | 1012 |
| 1015 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 1013 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
| 1016 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM]]) | 1014 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"]]) |
| 1017 self.assertEquals(0, result) | 1015 self.assertEquals(0, result) |
| 1018 | 1016 |
| 1019 def testAutoRoll(self): | 1017 def testAutoRoll(self): |
| 1020 TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory() | 1018 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 1021 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS")) | 1019 TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG["CHROMIUM"], "DEPS")) |
| 1022 TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile() | 1020 TEST_CONFIG["CLUSTERFUZZ_API_KEY_FILE"] = self.MakeEmptyTempFile() |
| 1023 TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE]) | 1021 TextToFile("fake key", TEST_CONFIG["CLUSTERFUZZ_API_KEY_FILE"]) |
| 1024 | 1022 |
| 1025 self.Expect([ | 1023 self.Expect([ |
| 1026 URL("https://codereview.chromium.org/search", | 1024 URL("https://codereview.chromium.org/search", |
| 1027 "owner=author%40chromium.org&limit=30&closed=3&format=json", | 1025 "owner=author%40chromium.org&limit=30&closed=3&format=json", |
| 1028 ("{\"results\": [{\"subject\": \"different\"}]}")), | 1026 ("{\"results\": [{\"subject\": \"different\"}]}")), |
| 1029 Cmd(("git log -1 --format=%H --grep=" | 1027 Cmd(("git log -1 --format=%H --grep=" |
| 1030 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " | 1028 "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " |
| 1031 "origin/master"), "push_hash\n"), | 1029 "origin/master"), "push_hash\n"), |
| 1032 Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG), | 1030 Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG), |
| 1033 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), | 1031 Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG), |
| 1034 ]) | 1032 ]) |
| 1035 | 1033 |
| 1036 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( | 1034 result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( |
| 1037 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG[CHROMIUM], "--roll"]) | 1035 AUTO_PUSH_ARGS + ["-c", TEST_CONFIG["CHROMIUM"], "--roll"]) |
| 1038 self.assertEquals(0, result) | 1036 self.assertEquals(0, result) |
| 1039 | 1037 |
| 1040 def testMergeToBranch(self): | 1038 def testMergeToBranch(self): |
| 1041 TEST_CONFIG[ALREADY_MERGING_SENTINEL_FILE] = self.MakeEmptyTempFile() | 1039 TEST_CONFIG["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile() |
| 1042 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) | 1040 TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 1043 self.WriteFakeVersionFile(build=5) | 1041 self.WriteFakeVersionFile(build=5) |
| 1044 os.environ["EDITOR"] = "vi" | 1042 os.environ["EDITOR"] = "vi" |
| 1045 extra_patch = self.MakeEmptyTempFile() | 1043 extra_patch = self.MakeEmptyTempFile() |
| 1046 | 1044 |
| 1047 def VerifyPatch(patch): | 1045 def VerifyPatch(patch): |
| 1048 return lambda: self.assertEquals(patch, | 1046 return lambda: self.assertEquals(patch, |
| 1049 FileToText(TEST_CONFIG[TEMPORARY_PATCH_FILE])) | 1047 FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"])) |
| 1050 | 1048 |
| 1051 msg = """Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789) | 1049 msg = """Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789) |
| 1052 | 1050 |
| 1053 Title4 | 1051 Title4 |
| 1054 | 1052 |
| 1055 Title2 | 1053 Title2 |
| 1056 | 1054 |
| 1057 Title3 | 1055 Title3 |
| 1058 | 1056 |
| 1059 Title1 | 1057 Title1 |
| 1060 | 1058 |
| 1061 Revert "Something" | 1059 Revert "Something" |
| 1062 | 1060 |
| 1063 BUG=123,234,345,456,567,v8:123 | 1061 BUG=123,234,345,456,567,v8:123 |
| 1064 LOG=N | 1062 LOG=N |
| 1065 """ | 1063 """ |
| 1066 | 1064 |
| 1067 def VerifySVNCommit(): | 1065 def VerifySVNCommit(): |
| 1068 commit = FileToText(TEST_CONFIG[COMMITMSG_FILE]) | 1066 commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
| 1069 self.assertEquals(msg, commit) | 1067 self.assertEquals(msg, commit) |
| 1070 version = FileToText( | 1068 version = FileToText( |
| 1071 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) | 1069 os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE)) |
| 1072 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) | 1070 self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version)) |
| 1073 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) | 1071 self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version)) |
| 1074 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+1", version)) | 1072 self.assertTrue(re.search(r"#define PATCH_LEVEL\s+1", version)) |
| 1075 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) | 1073 self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version)) |
| 1076 | 1074 |
| 1077 self.Expect([ | 1075 self.Expect([ |
| 1078 Cmd("git status -s -uno", ""), | 1076 Cmd("git status -s -uno", ""), |
| 1079 Cmd("git status -s -b -uno", "## some_branch\n"), | 1077 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 1080 Cmd("git svn fetch", ""), | 1078 Cmd("git svn fetch", ""), |
| 1081 Cmd("git branch", " branch1\n* branch2\n"), | 1079 Cmd("git branch", " branch1\n* branch2\n"), |
| 1082 Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG[BRANCHNAME], ""), | 1080 Cmd("git checkout -b %s svn/trunk" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1083 Cmd(("git log --format=%H --grep=\"Port r12345\" " | 1081 Cmd(("git log --format=%H --grep=\"Port r12345\" " |
| 1084 "--reverse svn/bleeding_edge"), | 1082 "--reverse svn/bleeding_edge"), |
| 1085 "hash1\nhash2"), | 1083 "hash1\nhash2"), |
| 1086 Cmd("git svn find-rev hash1 svn/bleeding_edge", "45678"), | 1084 Cmd("git svn find-rev hash1 svn/bleeding_edge", "45678"), |
| 1087 Cmd("git log -1 --format=%s hash1", "Title1"), | 1085 Cmd("git log -1 --format=%s hash1", "Title1"), |
| 1088 Cmd("git svn find-rev hash2 svn/bleeding_edge", "23456"), | 1086 Cmd("git svn find-rev hash2 svn/bleeding_edge", "23456"), |
| 1089 Cmd("git log -1 --format=%s hash2", "Title2"), | 1087 Cmd("git log -1 --format=%s hash2", "Title2"), |
| 1090 Cmd(("git log --format=%H --grep=\"Port r23456\" " | 1088 Cmd(("git log --format=%H --grep=\"Port r23456\" " |
| 1091 "--reverse svn/bleeding_edge"), | 1089 "--reverse svn/bleeding_edge"), |
| 1092 ""), | 1090 ""), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1110 Cmd("git log -1 --format=%s hash3", "Title3"), | 1108 Cmd("git log -1 --format=%s hash3", "Title3"), |
| 1111 Cmd("git log -1 --format=%s hash1", "Title1"), | 1109 Cmd("git log -1 --format=%s hash1", "Title1"), |
| 1112 Cmd("git log -1 --format=%s hash5", "Revert \"Something\""), | 1110 Cmd("git log -1 --format=%s hash5", "Revert \"Something\""), |
| 1113 Cmd("git log -1 hash4", "Title4\nBUG=123\nBUG=234"), | 1111 Cmd("git log -1 hash4", "Title4\nBUG=123\nBUG=234"), |
| 1114 Cmd("git log -1 hash2", "Title2\n BUG = v8:123,345"), | 1112 Cmd("git log -1 hash2", "Title2\n BUG = v8:123,345"), |
| 1115 Cmd("git log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"), | 1113 Cmd("git log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"), |
| 1116 Cmd("git log -1 hash1", "Title1\nBUG="), | 1114 Cmd("git log -1 hash1", "Title1\nBUG="), |
| 1117 Cmd("git log -1 hash5", "Revert \"Something\"\nBUG=none"), | 1115 Cmd("git log -1 hash5", "Revert \"Something\"\nBUG=none"), |
| 1118 Cmd("git log -1 -p hash4", "patch4"), | 1116 Cmd("git log -1 -p hash4", "patch4"), |
| 1119 Cmd(("git apply --index --reject \"%s\"" % | 1117 Cmd(("git apply --index --reject \"%s\"" % |
| 1120 TEST_CONFIG[TEMPORARY_PATCH_FILE]), | 1118 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1121 "", cb=VerifyPatch("patch4")), | 1119 "", cb=VerifyPatch("patch4")), |
| 1122 Cmd("git log -1 -p hash2", "patch2"), | 1120 Cmd("git log -1 -p hash2", "patch2"), |
| 1123 Cmd(("git apply --index --reject \"%s\"" % | 1121 Cmd(("git apply --index --reject \"%s\"" % |
| 1124 TEST_CONFIG[TEMPORARY_PATCH_FILE]), | 1122 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1125 "", cb=VerifyPatch("patch2")), | 1123 "", cb=VerifyPatch("patch2")), |
| 1126 Cmd("git log -1 -p hash3", "patch3"), | 1124 Cmd("git log -1 -p hash3", "patch3"), |
| 1127 Cmd(("git apply --index --reject \"%s\"" % | 1125 Cmd(("git apply --index --reject \"%s\"" % |
| 1128 TEST_CONFIG[TEMPORARY_PATCH_FILE]), | 1126 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1129 "", cb=VerifyPatch("patch3")), | 1127 "", cb=VerifyPatch("patch3")), |
| 1130 Cmd("git log -1 -p hash1", "patch1"), | 1128 Cmd("git log -1 -p hash1", "patch1"), |
| 1131 Cmd(("git apply --index --reject \"%s\"" % | 1129 Cmd(("git apply --index --reject \"%s\"" % |
| 1132 TEST_CONFIG[TEMPORARY_PATCH_FILE]), | 1130 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1133 "", cb=VerifyPatch("patch1")), | 1131 "", cb=VerifyPatch("patch1")), |
| 1134 Cmd("git log -1 -p hash5", "patch5\n"), | 1132 Cmd("git log -1 -p hash5", "patch5\n"), |
| 1135 Cmd(("git apply --index --reject \"%s\"" % | 1133 Cmd(("git apply --index --reject \"%s\"" % |
| 1136 TEST_CONFIG[TEMPORARY_PATCH_FILE]), | 1134 TEST_CONFIG["TEMPORARY_PATCH_FILE"]), |
| 1137 "", cb=VerifyPatch("patch5\n")), | 1135 "", cb=VerifyPatch("patch5\n")), |
| 1138 Cmd("git apply --index --reject \"%s\"" % extra_patch, ""), | 1136 Cmd("git apply --index --reject \"%s\"" % extra_patch, ""), |
| 1139 RL("Y"), # Automatically increment patch level? | 1137 RL("Y"), # Automatically increment patch level? |
| 1140 Cmd("git commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], ""), | 1138 Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""), |
| 1141 RL("reviewer@chromium.org"), # V8 reviewer. | 1139 RL("reviewer@chromium.org"), # V8 reviewer. |
| 1142 Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" " | 1140 Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" " |
| 1143 "--bypass-hooks", ""), | 1141 "--bypass-hooks", ""), |
| 1144 Cmd("git checkout -f %s" % TEST_CONFIG[BRANCHNAME], ""), | 1142 Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1145 RL("LGTM"), # Enter LGTM for V8 CL. | 1143 RL("LGTM"), # Enter LGTM for V8 CL. |
| 1146 Cmd("git cl presubmit", "Presubmit successfull\n"), | 1144 Cmd("git cl presubmit", "Presubmit successfull\n"), |
| 1147 Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n", | 1145 Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n", |
| 1148 cb=VerifySVNCommit), | 1146 cb=VerifySVNCommit), |
| 1149 Cmd("git svn fetch", ""), | 1147 Cmd("git svn fetch", ""), |
| 1150 Cmd(("git log -1 --format=%%H --grep=\"%s\" svn/trunk" | 1148 Cmd(("git log -1 --format=%%H --grep=\"%s\" svn/trunk" |
| 1151 % msg.replace("\"", "\\\"")), "hash6"), | 1149 % msg.replace("\"", "\\\"")), "hash6"), |
| 1152 Cmd("git svn find-rev hash6", "1324"), | 1150 Cmd("git svn find-rev hash6", "1324"), |
| 1153 Cmd(("svn copy -r 1324 https://v8.googlecode.com/svn/trunk " | 1151 Cmd(("svn copy -r 1324 https://v8.googlecode.com/svn/trunk " |
| 1154 "https://v8.googlecode.com/svn/tags/3.22.5.1 -m " | 1152 "https://v8.googlecode.com/svn/tags/3.22.5.1 -m " |
| 1155 "\"Tagging version 3.22.5.1\""), ""), | 1153 "\"Tagging version 3.22.5.1\""), ""), |
| 1156 Cmd("git checkout -f some_branch", ""), | 1154 Cmd("git checkout -f some_branch", ""), |
| 1157 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 1155 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1158 ]) | 1156 ]) |
| 1159 | 1157 |
| 1160 # r12345 and r34567 are patches. r23456 (included) and r45678 are the MIPS | 1158 # r12345 and r34567 are patches. r23456 (included) and r45678 are the MIPS |
| 1161 # ports of r12345. r56789 is the MIPS port of r34567. | 1159 # ports of r12345. r56789 is the MIPS port of r34567. |
| 1162 args = ["-f", "-p", extra_patch, "--branch", "trunk", "12345", "23456", | 1160 args = ["-f", "-p", extra_patch, "--branch", "trunk", "12345", "23456", |
| 1163 "34567"] | 1161 "34567"] |
| 1164 | 1162 |
| 1165 # The first run of the script stops because of the svn being down. | 1163 # The first run of the script stops because of the svn being down. |
| 1166 self.assertRaises(GitFailedException, | 1164 self.assertRaises(GitFailedException, |
| 1167 lambda: MergeToBranch(TEST_CONFIG, self).Run(args)) | 1165 lambda: MergeToBranch(TEST_CONFIG, self).Run(args)) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 """ | 1213 """ |
| 1216 c_hash3_commit_log = """Simple. | 1214 c_hash3_commit_log = """Simple. |
| 1217 | 1215 |
| 1218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b | 1216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b |
| 1219 | 1217 |
| 1220 """ | 1218 """ |
| 1221 json_output = self.MakeEmptyTempFile() | 1219 json_output = self.MakeEmptyTempFile() |
| 1222 csv_output = self.MakeEmptyTempFile() | 1220 csv_output = self.MakeEmptyTempFile() |
| 1223 self.WriteFakeVersionFile() | 1221 self.WriteFakeVersionFile() |
| 1224 | 1222 |
| 1225 TEST_CONFIG[CHROMIUM] = self.MakeEmptyTempDirectory() | 1223 TEST_CONFIG["CHROMIUM"] = self.MakeEmptyTempDirectory() |
| 1226 chrome_dir = TEST_CONFIG[CHROMIUM] | 1224 chrome_dir = TEST_CONFIG["CHROMIUM"] |
| 1227 chrome_v8_dir = os.path.join(chrome_dir, "v8") | 1225 chrome_v8_dir = os.path.join(chrome_dir, "v8") |
| 1228 os.makedirs(chrome_v8_dir) | 1226 os.makedirs(chrome_v8_dir) |
| 1229 def WriteDEPS(revision): | 1227 def WriteDEPS(revision): |
| 1230 TextToFile("Line\n \"v8_revision\": \"%s\",\n line\n" % revision, | 1228 TextToFile("Line\n \"v8_revision\": \"%s\",\n line\n" % revision, |
| 1231 os.path.join(chrome_dir, "DEPS")) | 1229 os.path.join(chrome_dir, "DEPS")) |
| 1232 WriteDEPS(567) | 1230 WriteDEPS(567) |
| 1233 | 1231 |
| 1234 def ResetVersion(minor, build, patch=0): | 1232 def ResetVersion(minor, build, patch=0): |
| 1235 return lambda: self.WriteFakeVersionFile(minor=minor, | 1233 return lambda: self.WriteFakeVersionFile(minor=minor, |
| 1236 build=build, | 1234 build=build, |
| 1237 patch=patch) | 1235 patch=patch) |
| 1238 | 1236 |
| 1239 def ResetDEPS(revision): | 1237 def ResetDEPS(revision): |
| 1240 return lambda: WriteDEPS(revision) | 1238 return lambda: WriteDEPS(revision) |
| 1241 | 1239 |
| 1242 self.Expect([ | 1240 self.Expect([ |
| 1243 Cmd("git status -s -uno", ""), | 1241 Cmd("git status -s -uno", ""), |
| 1244 Cmd("git status -s -b -uno", "## some_branch\n"), | 1242 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 1245 Cmd("git svn fetch", ""), | 1243 Cmd("git svn fetch", ""), |
| 1246 Cmd("git branch", " branch1\n* branch2\n"), | 1244 Cmd("git branch", " branch1\n* branch2\n"), |
| 1247 Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], ""), | 1245 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1248 Cmd("git branch -r", " svn/3.21\n svn/3.3\n"), | 1246 Cmd("git branch -r", " svn/3.21\n svn/3.3\n"), |
| 1249 Cmd("git reset --hard svn/3.3", ""), | 1247 Cmd("git reset --hard svn/3.3", ""), |
| 1250 Cmd("git log --format=%H", "hash1\nhash2"), | 1248 Cmd("git log --format=%H", "hash1\nhash2"), |
| 1251 Cmd("git diff --name-only hash1 hash1^", ""), | 1249 Cmd("git diff --name-only hash1 hash1^", ""), |
| 1252 Cmd("git diff --name-only hash2 hash2^", VERSION_FILE), | 1250 Cmd("git diff --name-only hash2 hash2^", VERSION_FILE), |
| 1253 Cmd("git checkout -f hash2 -- %s" % VERSION_FILE, "", | 1251 Cmd("git checkout -f hash2 -- %s" % VERSION_FILE, "", |
| 1254 cb=ResetVersion(3, 1, 1)), | 1252 cb=ResetVersion(3, 1, 1)), |
| 1255 Cmd("git log -1 --format=%B hash2", | 1253 Cmd("git log -1 --format=%B hash2", |
| 1256 "Version 3.3.1.1 (merged 12)\n\nReview URL: fake.com\n"), | 1254 "Version 3.3.1.1 (merged 12)\n\nReview URL: fake.com\n"), |
| 1257 Cmd("git log -1 --format=%s hash2", ""), | 1255 Cmd("git log -1 --format=%s hash2", ""), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1286 tag_response_text), | 1284 tag_response_text), |
| 1287 Cmd("git svn find-rev r22626", "hash_22626"), | 1285 Cmd("git svn find-rev r22626", "hash_22626"), |
| 1288 Cmd("git svn find-rev hash_22626", "22626"), | 1286 Cmd("git svn find-rev hash_22626", "22626"), |
| 1289 Cmd("git log -1 --format=%ci hash_22626", "01:23"), | 1287 Cmd("git log -1 --format=%ci hash_22626", "01:23"), |
| 1290 Cmd("git svn find-rev r22624", "hash_22624"), | 1288 Cmd("git svn find-rev r22624", "hash_22624"), |
| 1291 Cmd("git svn find-rev hash_22624", "22624"), | 1289 Cmd("git svn find-rev hash_22624", "22624"), |
| 1292 Cmd("git log -1 --format=%ci hash_22624", "02:34"), | 1290 Cmd("git log -1 --format=%ci hash_22624", "02:34"), |
| 1293 Cmd("git status -s -uno", "", cwd=chrome_dir), | 1291 Cmd("git status -s -uno", "", cwd=chrome_dir), |
| 1294 Cmd("git checkout -f master", "", cwd=chrome_dir), | 1292 Cmd("git checkout -f master", "", cwd=chrome_dir), |
| 1295 Cmd("git pull", "", cwd=chrome_dir), | 1293 Cmd("git pull", "", cwd=chrome_dir), |
| 1296 Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], "", cwd=chrome_dir), | 1294 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir), |
| 1297 Cmd("git fetch origin", "", cwd=chrome_v8_dir), | 1295 Cmd("git fetch origin", "", cwd=chrome_v8_dir), |
| 1298 Cmd("git log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\nc_hash3\n", | 1296 Cmd("git log --format=%H --grep=\"V8\"", "c_hash1\nc_hash2\nc_hash3\n", |
| 1299 cwd=chrome_dir), | 1297 cwd=chrome_dir), |
| 1300 Cmd("git diff --name-only c_hash1 c_hash1^", "", cwd=chrome_dir), | 1298 Cmd("git diff --name-only c_hash1 c_hash1^", "", cwd=chrome_dir), |
| 1301 Cmd("git diff --name-only c_hash2 c_hash2^", "DEPS", cwd=chrome_dir), | 1299 Cmd("git diff --name-only c_hash2 c_hash2^", "DEPS", cwd=chrome_dir), |
| 1302 Cmd("git checkout -f c_hash2 -- DEPS", "", | 1300 Cmd("git checkout -f c_hash2 -- DEPS", "", |
| 1303 cb=ResetDEPS("0123456789012345678901234567890123456789"), | 1301 cb=ResetDEPS("0123456789012345678901234567890123456789"), |
| 1304 cwd=chrome_dir), | 1302 cwd=chrome_dir), |
| 1305 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log, | 1303 Cmd("git log -1 --format=%B c_hash2", c_hash2_commit_log, |
| 1306 cwd=chrome_dir), | 1304 cwd=chrome_dir), |
| 1307 Cmd("git rev-list -n 1 0123456789012345678901234567890123456789", | 1305 Cmd("git rev-list -n 1 0123456789012345678901234567890123456789", |
| 1308 "0123456789012345678901234567890123456789", cwd=chrome_v8_dir), | 1306 "0123456789012345678901234567890123456789", cwd=chrome_v8_dir), |
| 1309 Cmd("git log -1 --format=%B 0123456789012345678901234567890123456789", | 1307 Cmd("git log -1 --format=%B 0123456789012345678901234567890123456789", |
| 1310 self.C_V8_22624_LOG, cwd=chrome_v8_dir), | 1308 self.C_V8_22624_LOG, cwd=chrome_v8_dir), |
| 1311 Cmd("git diff --name-only c_hash3 c_hash3^", "DEPS", cwd=chrome_dir), | 1309 Cmd("git diff --name-only c_hash3 c_hash3^", "DEPS", cwd=chrome_dir), |
| 1312 Cmd("git checkout -f c_hash3 -- DEPS", "", cb=ResetDEPS(345), | 1310 Cmd("git checkout -f c_hash3 -- DEPS", "", cb=ResetDEPS(345), |
| 1313 cwd=chrome_dir), | 1311 cwd=chrome_dir), |
| 1314 Cmd("git log -1 --format=%B c_hash3", c_hash3_commit_log, | 1312 Cmd("git log -1 --format=%B c_hash3", c_hash3_commit_log, |
| 1315 cwd=chrome_dir), | 1313 cwd=chrome_dir), |
| 1316 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567), | 1314 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567), |
| 1317 cwd=chrome_dir), | 1315 cwd=chrome_dir), |
| 1318 Cmd("git branch -r", " weird/123\n branch-heads/7\n", cwd=chrome_dir), | 1316 Cmd("git branch -r", " weird/123\n branch-heads/7\n", cwd=chrome_dir), |
| 1319 Cmd("git checkout -f branch-heads/7 -- DEPS", "", cb=ResetDEPS(345), | 1317 Cmd("git checkout -f branch-heads/7 -- DEPS", "", cb=ResetDEPS(345), |
| 1320 cwd=chrome_dir), | 1318 cwd=chrome_dir), |
| 1321 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567), | 1319 Cmd("git checkout -f HEAD -- DEPS", "", cb=ResetDEPS(567), |
| 1322 cwd=chrome_dir), | 1320 cwd=chrome_dir), |
| 1323 Cmd("git checkout -f master", "", cwd=chrome_dir), | 1321 Cmd("git checkout -f master", "", cwd=chrome_dir), |
| 1324 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], "", cwd=chrome_dir), | 1322 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], "", cwd=chrome_dir), |
| 1325 Cmd("git checkout -f some_branch", ""), | 1323 Cmd("git checkout -f some_branch", ""), |
| 1326 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 1324 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1327 ]) | 1325 ]) |
| 1328 | 1326 |
| 1329 args = ["-c", TEST_CONFIG[CHROMIUM], | 1327 args = ["-c", TEST_CONFIG["CHROMIUM"], |
| 1330 "--json", json_output, | 1328 "--json", json_output, |
| 1331 "--csv", csv_output, | 1329 "--csv", csv_output, |
| 1332 "--max-releases", "1"] | 1330 "--max-releases", "1"] |
| 1333 Releases(TEST_CONFIG, self).Run(args) | 1331 Releases(TEST_CONFIG, self).Run(args) |
| 1334 | 1332 |
| 1335 # Check expected output. | 1333 # Check expected output. |
| 1336 csv = ("3.28.41,bleeding_edge,22626,,\r\n" | 1334 csv = ("3.28.41,bleeding_edge,22626,,\r\n" |
| 1337 "3.28.40,bleeding_edge,22624,4567,\r\n" | 1335 "3.28.40,bleeding_edge,22624,4567,\r\n" |
| 1338 "3.22.3,trunk,345,3456:4566,\r\n" | 1336 "3.22.3,trunk,345,3456:4566,\r\n" |
| 1339 "3.21.2,3.21,123,,\r\n" | 1337 "3.21.2,3.21,123,,\r\n" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 Cmd("git cl dcommit -f --bypass-hooks", ""), | 1408 Cmd("git cl dcommit -f --bypass-hooks", ""), |
| 1411 Cmd("git checkout -f bleeding_edge", ""), | 1409 Cmd("git checkout -f bleeding_edge", ""), |
| 1412 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), | 1410 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), |
| 1413 Cmd("git branch -D auto-bump-up-version", ""), | 1411 Cmd("git branch -D auto-bump-up-version", ""), |
| 1414 ] | 1412 ] |
| 1415 self.Expect(expectations) | 1413 self.Expect(expectations) |
| 1416 | 1414 |
| 1417 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) | 1415 BumpUpVersion(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) |
| 1418 | 1416 |
| 1419 def testBumpUpVersionSvn(self): | 1417 def testBumpUpVersionSvn(self): |
| 1418 svn_root = self.MakeEmptyTempDirectory() |
| 1420 expectations = self._bumpUpVersion() | 1419 expectations = self._bumpUpVersion() |
| 1421 expectations += [ | 1420 expectations += [ |
| 1422 Cmd("git diff HEAD^ HEAD", "patch content"), | 1421 Cmd("git diff HEAD^ HEAD", "patch content"), |
| 1423 Cmd("svn update", "", cwd="[SVN_ROOT]"), | 1422 Cmd("svn update", "", cwd=svn_root), |
| 1424 Cmd("svn status", "", cwd="[SVN_ROOT]"), | 1423 Cmd("svn status", "", cwd=svn_root), |
| 1425 Cmd("patch -d branches/bleeding_edge -p1 -i %s" % | 1424 Cmd("patch -d branches/bleeding_edge -p1 -i %s" % |
| 1426 TEST_CONFIG[PATCH_FILE], "Applied patch...", cwd="[SVN_ROOT]"), | 1425 TEST_CONFIG["PATCH_FILE"], "Applied patch...", cwd=svn_root), |
| 1427 Cmd("svn commit --non-interactive --username=author@chromium.org " | 1426 Cmd("svn commit --non-interactive --username=author@chromium.org " |
| 1428 "--config-dir=[CONFIG_DIR] " | 1427 "--config-dir=[CONFIG_DIR] " |
| 1429 "-m \"[Auto-roll] Bump up version to 3.11.6.0\"", | 1428 "-m \"[Auto-roll] Bump up version to 3.11.6.0\"", |
| 1430 "", cwd="[SVN_ROOT]"), | 1429 "", cwd=svn_root), |
| 1431 Cmd("git checkout -f bleeding_edge", ""), | 1430 Cmd("git checkout -f bleeding_edge", ""), |
| 1432 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), | 1431 Cmd("git branch", "auto-bump-up-version\n* bleeding_edge"), |
| 1433 Cmd("git branch -D auto-bump-up-version", ""), | 1432 Cmd("git branch -D auto-bump-up-version", ""), |
| 1434 ] | 1433 ] |
| 1435 self.Expect(expectations) | 1434 self.Expect(expectations) |
| 1436 | 1435 |
| 1437 BumpUpVersion(TEST_CONFIG, self).Run( | 1436 BumpUpVersion(TEST_CONFIG, self).Run( |
| 1438 ["-a", "author@chromium.org", | 1437 ["-a", "author@chromium.org", |
| 1439 "--svn", "[SVN_ROOT]", | 1438 "--svn", svn_root, |
| 1440 "--svn-config", "[CONFIG_DIR]"]) | 1439 "--svn-config", "[CONFIG_DIR]"]) |
| 1441 | 1440 |
| 1442 def testAutoTag(self): | 1441 def testAutoTag(self): |
| 1443 self.WriteFakeVersionFile() | 1442 self.WriteFakeVersionFile() |
| 1444 | 1443 |
| 1445 def ResetVersion(minor, build, patch=0): | 1444 def ResetVersion(minor, build, patch=0): |
| 1446 return lambda: self.WriteFakeVersionFile(minor=minor, | 1445 return lambda: self.WriteFakeVersionFile(minor=minor, |
| 1447 build=build, | 1446 build=build, |
| 1448 patch=patch) | 1447 patch=patch) |
| 1449 | 1448 |
| 1450 self.Expect([ | 1449 self.Expect([ |
| 1451 Cmd("git status -s -uno", ""), | 1450 Cmd("git status -s -uno", ""), |
| 1452 Cmd("git status -s -b -uno", "## some_branch\n"), | 1451 Cmd("git status -s -b -uno", "## some_branch\n"), |
| 1453 Cmd("git svn fetch", ""), | 1452 Cmd("git svn fetch", ""), |
| 1454 Cmd("git branch", " branch1\n* branch2\n"), | 1453 Cmd("git branch", " branch1\n* branch2\n"), |
| 1455 Cmd("git checkout -f master", ""), | 1454 Cmd("git checkout -f master", ""), |
| 1456 Cmd("git svn rebase", ""), | 1455 Cmd("git svn rebase", ""), |
| 1457 Cmd("git checkout -b %s" % TEST_CONFIG[BRANCHNAME], "", | 1456 Cmd("git checkout -b %s" % TEST_CONFIG["BRANCHNAME"], "", |
| 1458 cb=ResetVersion(4, 5)), | 1457 cb=ResetVersion(4, 5)), |
| 1459 Cmd("git branch -r", | 1458 Cmd("git branch -r", |
| 1460 "svn/tags/3.4.2\nsvn/tags/3.2.1.0\nsvn/branches/3.4"), | 1459 "svn/tags/3.4.2\nsvn/tags/3.2.1.0\nsvn/branches/3.4"), |
| 1461 Cmd(("git log --format=%H --grep=" | 1460 Cmd(("git log --format=%H --grep=" |
| 1462 "\"\\[Auto\\-roll\\] Bump up version to\""), | 1461 "\"\\[Auto\\-roll\\] Bump up version to\""), |
| 1463 "hash125\nhash118\nhash111\nhash101"), | 1462 "hash125\nhash118\nhash111\nhash101"), |
| 1464 Cmd("git checkout -f hash125 -- %s" % VERSION_FILE, "", | 1463 Cmd("git checkout -f hash125 -- %s" % VERSION_FILE, "", |
| 1465 cb=ResetVersion(4, 4)), | 1464 cb=ResetVersion(4, 4)), |
| 1466 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", | 1465 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", |
| 1467 cb=ResetVersion(4, 5)), | 1466 cb=ResetVersion(4, 5)), |
| 1468 Cmd("git checkout -f hash118 -- %s" % VERSION_FILE, "", | 1467 Cmd("git checkout -f hash118 -- %s" % VERSION_FILE, "", |
| 1469 cb=ResetVersion(4, 3)), | 1468 cb=ResetVersion(4, 3)), |
| 1470 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", | 1469 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", |
| 1471 cb=ResetVersion(4, 5)), | 1470 cb=ResetVersion(4, 5)), |
| 1472 Cmd("git checkout -f hash111 -- %s" % VERSION_FILE, "", | 1471 Cmd("git checkout -f hash111 -- %s" % VERSION_FILE, "", |
| 1473 cb=ResetVersion(4, 2)), | 1472 cb=ResetVersion(4, 2)), |
| 1474 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", | 1473 Cmd("git checkout -f HEAD -- %s" % VERSION_FILE, "", |
| 1475 cb=ResetVersion(4, 5)), | 1474 cb=ResetVersion(4, 5)), |
| 1476 URL("https://v8-status.appspot.com/revisions?format=json", | 1475 URL("https://v8-status.appspot.com/revisions?format=json", |
| 1477 "[{\"revision\": \"126\", \"status\": true}," | 1476 "[{\"revision\": \"126\", \"status\": true}," |
| 1478 "{\"revision\": \"123\", \"status\": true}," | 1477 "{\"revision\": \"123\", \"status\": true}," |
| 1479 "{\"revision\": \"112\", \"status\": true}]"), | 1478 "{\"revision\": \"112\", \"status\": true}]"), |
| 1480 Cmd("git svn find-rev hash118", "118"), | 1479 Cmd("git svn find-rev hash118", "118"), |
| 1481 Cmd("git svn find-rev hash125", "125"), | 1480 Cmd("git svn find-rev hash125", "125"), |
| 1482 Cmd("git svn find-rev r123", "hash123"), | 1481 Cmd("git svn find-rev r123", "hash123"), |
| 1483 Cmd("git log -1 --format=%at hash123", "1"), | 1482 Cmd("git log -1 --format=%at hash123", "1"), |
| 1484 Cmd("git reset --hard hash123", ""), | 1483 Cmd("git reset --hard hash123", ""), |
| 1485 Cmd("git svn tag 3.4.3 -m \"Tagging version 3.4.3\"", ""), | 1484 Cmd("git svn tag 3.4.3 -m \"Tagging version 3.4.3\"", ""), |
| 1486 Cmd("git checkout -f some_branch", ""), | 1485 Cmd("git checkout -f some_branch", ""), |
| 1487 Cmd("git branch -D %s" % TEST_CONFIG[BRANCHNAME], ""), | 1486 Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""), |
| 1488 ]) | 1487 ]) |
| 1489 | 1488 |
| 1490 AutoTag(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) | 1489 AutoTag(TEST_CONFIG, self).Run(["-a", "author@chromium.org"]) |
| 1491 | 1490 |
| 1492 # Test that we bail out if the last change was a version change. | 1491 # Test that we bail out if the last change was a version change. |
| 1493 def testBumpUpVersionBailout1(self): | 1492 def testBumpUpVersionBailout1(self): |
| 1494 self._state["latest"] = "latest_hash" | 1493 self._state["latest"] = "latest_hash" |
| 1495 | 1494 |
| 1496 self.Expect([ | 1495 self.Expect([ |
| 1497 Cmd("git diff --name-only latest_hash latest_hash^", VERSION_FILE), | 1496 Cmd("git diff --name-only latest_hash latest_hash^", VERSION_FILE), |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 | 1539 |
| 1541 Review URL: https://codereview.chromium.org/83173002 | 1540 Review URL: https://codereview.chromium.org/83173002 |
| 1542 | 1541 |
| 1543 ------------------------------------------------------------------------""") | 1542 ------------------------------------------------------------------------""") |
| 1544 self.assertEquals( | 1543 self.assertEquals( |
| 1545 """Prepare push to trunk. Now working on version 3.23.11. | 1544 """Prepare push to trunk. Now working on version 3.23.11. |
| 1546 | 1545 |
| 1547 R=danno@chromium.org | 1546 R=danno@chromium.org |
| 1548 | 1547 |
| 1549 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) | 1548 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) |
| OLD | NEW |