(self)
| 675 | RollMerge(TEST_CONFIG, self).Run(args) |
| 676 | |
| 677 | def testMergeToBranch(self): |
| 678 | TEST_CONFIG["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile() |
| 679 | TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git")) |
| 680 | self.WriteFakeVersionFile(build=5) |
| 681 | os.environ["EDITOR"] = "vi" |
| 682 | extra_patch = self.MakeEmptyTempFile() |
| 683 | |
| 684 | |
| 685 | def VerifyPatch(patch): |
| 686 | return lambda: self.assertEquals(patch, |
| 687 | FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"])) |
| 688 | |
| 689 | info_msg = ("NOTE: This script will no longer automatically " |
| 690 | "update include/v8-version.h " |
| 691 | "and create a tag. This is done automatically by the autotag bot. " |
| 692 | "Please call the merge_to_branch.py with --help for more information.") |
| 693 | |
| 694 | msg = """Merged: Squashed multiple commits. |
| 695 | |
| 696 | Merged: Title4 |
| 697 | Revision: ab12345 |
| 698 | |
| 699 | Merged: Title2 |
| 700 | Revision: ab23456 |
| 701 | |
| 702 | Merged: Title3 |
| 703 | Revision: ab34567 |
| 704 | |
| 705 | Merged: Title1 |
| 706 | Revision: ab45678 |
| 707 | |
| 708 | Merged: Revert \"Something\" |
| 709 | Revision: ab56789 |
| 710 | |
| 711 | BUG=123,234,345,456,567,v8:123 |
| 712 | """ |
| 713 | |
| 714 | def VerifyLand(): |
| 715 | commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"]) |
| 716 | self.assertEquals(msg, commit) |
| 717 | |
| 718 | self.Expect([ |
| 719 | Cmd("git status -s -uno", ""), |
| 720 | Cmd("git checkout -f origin/main", ""), |
| 721 | Cmd("git fetch", ""), |
| 722 | Cmd("git branch", " branch1\n* branch2\n"), |
| 723 | Cmd("git new-branch %s --upstream refs/remotes/origin/candidates" % |
| 724 | TEST_CONFIG["BRANCHNAME"], ""), |
| 725 | Cmd(("git log --format=%H --grep=\"^[Pp]ort ab12345\" " |
| 726 | "--reverse origin/main"), |
| 727 | "ab45678\nab23456"), |
| 728 | Cmd("git log -1 --format=%s ab45678", "Title1"), |
| 729 | Cmd("git log -1 --format=%s ab23456", "Title2"), |
| 730 | Cmd(("git log --format=%H --grep=\"^[Pp]ort ab23456\" " |
| 731 | "--reverse origin/main"), |
| 732 | ""), |
| 733 | Cmd(("git log --format=%H --grep=\"^[Pp]ort ab34567\" " |
| 734 | "--reverse origin/main"), |
nothing calls this directly
no test coverage detected