Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: tools/push-to-trunk/test_scripts.py

Issue 702843002: Make merge_to_branch more git-friendly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/push-to-trunk/releases.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/test_scripts.py
diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py
index f31c491dc0cee533869ab8bb1eb5efc2837286be..41cc97f77a47caac247dcd4bed72124e35096504 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -503,7 +503,7 @@ class ScriptTest(unittest.TestCase):
Cmd("git log -1 --format=%H --grep=\"Title\" origin/candidates", ""),
])
args = ["--branch", "candidates", "--vc-interface", "git_read_svn_write",
- "12345"]
+ "ab12345"]
self._state["version"] = "tag_name"
self._state["commit_title"] = "Title"
self.assertRaises(Exception,
@@ -1225,137 +1225,13 @@ deps = {
return lambda: self.assertEquals(patch,
FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"]))
- msg = """Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789)
+ msg = """Version 3.22.5.1 (cherry-pick)
-Title4
-
-Title2
-
-Title3
-
-Title1
-
-Revert "Something"
-
-BUG=123,234,345,456,567,v8:123
-LOG=N
-"""
-
- def VerifySVNCommit():
- commit = FileToText(TEST_CONFIG["COMMITMSG_FILE"])
- self.assertEquals(msg, commit)
- version = FileToText(
- os.path.join(TEST_CONFIG["DEFAULT_CWD"], VERSION_FILE))
- self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version))
- self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version))
- self.assertTrue(re.search(r"#define PATCH_LEVEL\s+1", version))
- self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
-
- self.Expect([
- Cmd("git status -s -uno", ""),
- Cmd("git status -s -b -uno", "## some_branch\n"),
- Cmd("git svn fetch", ""),
- Cmd("git branch", " branch1\n* branch2\n"),
- Cmd("git new-branch %s --upstream svn/trunk" % TEST_CONFIG["BRANCHNAME"],
- ""),
- Cmd(("git log --format=%H --grep=\"Port r12345\" "
- "--reverse svn/bleeding_edge"),
- "hash1\nhash2"),
- Cmd("git svn find-rev hash1 svn/bleeding_edge", "45678"),
- Cmd("git log -1 --format=%s hash1", "Title1"),
- Cmd("git svn find-rev hash2 svn/bleeding_edge", "23456"),
- Cmd("git log -1 --format=%s hash2", "Title2"),
- Cmd(("git log --format=%H --grep=\"Port r23456\" "
- "--reverse svn/bleeding_edge"),
- ""),
- Cmd(("git log --format=%H --grep=\"Port r34567\" "
- "--reverse svn/bleeding_edge"),
- "hash3"),
- Cmd("git svn find-rev hash3 svn/bleeding_edge", "56789"),
- Cmd("git log -1 --format=%s hash3", "Title3"),
- RL("Y"), # Automatically add corresponding ports (34567, 56789)?
- Cmd("git svn find-rev r12345 svn/bleeding_edge", "hash4"),
- # Simulate svn being down which stops the script.
- Cmd("git svn find-rev r23456 svn/bleeding_edge", None),
- # Restart script in the failing step.
- Cmd("git svn find-rev r12345 svn/bleeding_edge", "hash4"),
- Cmd("git svn find-rev r23456 svn/bleeding_edge", "hash2"),
- Cmd("git svn find-rev r34567 svn/bleeding_edge", "hash3"),
- Cmd("git svn find-rev r45678 svn/bleeding_edge", "hash1"),
- Cmd("git svn find-rev r56789 svn/bleeding_edge", "hash5"),
- Cmd("git log -1 --format=%s hash4", "Title4"),
- Cmd("git log -1 --format=%s hash2", "Title2"),
- Cmd("git log -1 --format=%s hash3", "Title3"),
- Cmd("git log -1 --format=%s hash1", "Title1"),
- Cmd("git log -1 --format=%s hash5", "Revert \"Something\""),
- Cmd("git log -1 hash4", "Title4\nBUG=123\nBUG=234"),
- Cmd("git log -1 hash2", "Title2\n BUG = v8:123,345"),
- Cmd("git log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"),
- Cmd("git log -1 hash1", "Title1\nBUG="),
- Cmd("git log -1 hash5", "Revert \"Something\"\nBUG=none"),
- Cmd("git log -1 -p hash4", "patch4"),
- Cmd(("git apply --index --reject \"%s\"" %
- TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
- "", cb=VerifyPatch("patch4")),
- Cmd("git log -1 -p hash2", "patch2"),
- Cmd(("git apply --index --reject \"%s\"" %
- TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
- "", cb=VerifyPatch("patch2")),
- Cmd("git log -1 -p hash3", "patch3"),
- Cmd(("git apply --index --reject \"%s\"" %
- TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
- "", cb=VerifyPatch("patch3")),
- Cmd("git log -1 -p hash1", "patch1"),
- Cmd(("git apply --index --reject \"%s\"" %
- TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
- "", cb=VerifyPatch("patch1")),
- Cmd("git log -1 -p hash5", "patch5\n"),
- Cmd(("git apply --index --reject \"%s\"" %
- TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
- "", cb=VerifyPatch("patch5\n")),
- Cmd("git apply --index --reject \"%s\"" % extra_patch, ""),
- RL("Y"), # Automatically increment patch level?
- Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], ""),
- RL("reviewer@chromium.org"), # V8 reviewer.
- Cmd("git cl upload --send-mail -r \"reviewer@chromium.org\" "
- "--bypass-hooks --cc \"ulan@chromium.org\"", ""),
- Cmd("git checkout -f %s" % TEST_CONFIG["BRANCHNAME"], ""),
- RL("LGTM"), # Enter LGTM for V8 CL.
- Cmd("git cl presubmit", "Presubmit successfull\n"),
- Cmd("git cl dcommit -f --bypass-hooks", "Closing issue\n",
- cb=VerifySVNCommit),
- Cmd("git svn fetch", ""),
- Cmd("git rebase svn/trunk", ""),
- Cmd("git svn tag 3.22.5.1 -m \"Tagging version 3.22.5.1\"", ""),
- Cmd("git checkout -f some_branch", ""),
- Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
- ])
-
- # r12345 and r34567 are patches. r23456 (included) and r45678 are the MIPS
- # ports of r12345. r56789 is the MIPS port of r34567.
- args = ["-f", "-p", extra_patch, "--branch", "trunk",
- "--vc-interface", "git_svn", "12345", "23456", "34567"]
-
- # The first run of the script stops because of the svn being down.
- self.assertRaises(GitFailedException,
- lambda: MergeToBranch(TEST_CONFIG, self).Run(args))
-
- # Test that state recovery after restarting the script works.
- args += ["-s", "4"]
- MergeToBranch(TEST_CONFIG, self).Run(args)
-
- def testMergeToBranchNewGit(self):
- TEST_CONFIG["ALREADY_MERGING_SENTINEL_FILE"] = self.MakeEmptyTempFile()
- TextToFile("", os.path.join(TEST_CONFIG["DEFAULT_CWD"], ".git"))
- self.WriteFakeVersionFile(build=5)
- os.environ["EDITOR"] = "vi"
- extra_patch = self.MakeEmptyTempFile()
-
- def VerifyPatch(patch):
- return lambda: self.assertEquals(patch,
- FileToText(TEST_CONFIG["TEMPORARY_PATCH_FILE"]))
-
- msg = """Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789)
+Merged ab12345
+Merged ab23456
+Merged ab34567
+Merged ab45678
+Merged ab56789
Title4
@@ -1389,59 +1265,49 @@ LOG=N
Cmd("git branch", " branch1\n* branch2\n"),
Cmd("git new-branch %s --upstream origin/candidates" %
TEST_CONFIG["BRANCHNAME"], ""),
- Cmd(("git log --format=%H --grep=\"Port r12345\" "
+ Cmd(("git log --format=%H --grep=\"Port ab12345\" "
"--reverse origin/master"),
- "hash1\nhash2"),
- Cmd("git svn find-rev hash1 origin/master", "45678"),
- Cmd("git log -1 --format=%s hash1", "Title1"),
- Cmd("git svn find-rev hash2 origin/master", "23456"),
- Cmd("git log -1 --format=%s hash2", "Title2"),
- Cmd(("git log --format=%H --grep=\"Port r23456\" "
+ "ab45678\nab23456"),
+ Cmd("git log -1 --format=%s ab45678", "Title1"),
+ Cmd("git log -1 --format=%s ab23456", "Title2"),
+ Cmd(("git log --format=%H --grep=\"Port ab23456\" "
"--reverse origin/master"),
""),
- Cmd(("git log --format=%H --grep=\"Port r34567\" "
+ Cmd(("git log --format=%H --grep=\"Port ab34567\" "
"--reverse origin/master"),
- "hash3"),
- Cmd("git svn find-rev hash3 origin/master", "56789"),
- Cmd("git log -1 --format=%s hash3", "Title3"),
- RL("Y"), # Automatically add corresponding ports (34567, 56789)?
- Cmd("git svn find-rev r12345 origin/master",
- "Partial-rebuilding bla\nDone rebuilding blub\nhash4"),
- # Simulate svn being down which stops the script.
- Cmd("git svn find-rev r23456 origin/master", None),
+ "ab56789"),
+ Cmd("git log -1 --format=%s ab56789", "Title3"),
+ RL("Y"), # Automatically add corresponding ports (ab34567, ab56789)?
+ # Simulate git being down which stops the script.
+ Cmd("git log -1 --format=%s ab12345", None),
# Restart script in the failing step.
- Cmd("git svn find-rev r12345 origin/master", "hash4"),
- Cmd("git svn find-rev r23456 origin/master", "hash2"),
- Cmd("git svn find-rev r34567 origin/master", "hash3"),
- Cmd("git svn find-rev r45678 origin/master", "hash1"),
- Cmd("git svn find-rev r56789 origin/master", "hash5"),
- Cmd("git log -1 --format=%s hash4", "Title4"),
- Cmd("git log -1 --format=%s hash2", "Title2"),
- Cmd("git log -1 --format=%s hash3", "Title3"),
- Cmd("git log -1 --format=%s hash1", "Title1"),
- Cmd("git log -1 --format=%s hash5", "Revert \"Something\""),
- Cmd("git log -1 hash4", "Title4\nBUG=123\nBUG=234"),
- Cmd("git log -1 hash2", "Title2\n BUG = v8:123,345"),
- Cmd("git log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"),
- Cmd("git log -1 hash1", "Title1\nBUG="),
- Cmd("git log -1 hash5", "Revert \"Something\"\nBUG=none"),
- Cmd("git log -1 -p hash4", "patch4"),
+ Cmd("git log -1 --format=%s ab12345", "Title4"),
+ Cmd("git log -1 --format=%s ab23456", "Title2"),
+ Cmd("git log -1 --format=%s ab34567", "Title3"),
+ Cmd("git log -1 --format=%s ab45678", "Title1"),
+ Cmd("git log -1 --format=%s ab56789", "Revert \"Something\""),
+ Cmd("git log -1 ab12345", "Title4\nBUG=123\nBUG=234"),
+ Cmd("git log -1 ab23456", "Title2\n BUG = v8:123,345"),
+ Cmd("git log -1 ab34567", "Title3\nLOG=n\nBUG=567, 456"),
+ Cmd("git log -1 ab45678", "Title1\nBUG="),
+ Cmd("git log -1 ab56789", "Revert \"Something\"\nBUG=none"),
+ Cmd("git log -1 -p ab12345", "patch4"),
Cmd(("git apply --index --reject \"%s\"" %
TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
"", cb=VerifyPatch("patch4")),
- Cmd("git log -1 -p hash2", "patch2"),
+ Cmd("git log -1 -p ab23456", "patch2"),
Cmd(("git apply --index --reject \"%s\"" %
TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
"", cb=VerifyPatch("patch2")),
- Cmd("git log -1 -p hash3", "patch3"),
+ Cmd("git log -1 -p ab34567", "patch3"),
Cmd(("git apply --index --reject \"%s\"" %
TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
"", cb=VerifyPatch("patch3")),
- Cmd("git log -1 -p hash1", "patch1"),
+ Cmd("git log -1 -p ab45678", "patch1"),
Cmd(("git apply --index --reject \"%s\"" %
TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
"", cb=VerifyPatch("patch1")),
- Cmd("git log -1 -p hash5", "patch5\n"),
+ Cmd("git log -1 -p ab56789", "patch5\n"),
Cmd(("git apply --index --reject \"%s\"" %
TEST_CONFIG["TEMPORARY_PATCH_FILE"]),
"", cb=VerifyPatch("patch5\n")),
@@ -1458,12 +1324,12 @@ LOG=N
cb=VerifySVNCommit),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep=\""
- "Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789)"
+ "Version 3.22.5.1 (cherry-pick)"
"\" origin/candidates",
""),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep=\""
- "Version 3.22.5.1 (merged r12345, r23456, r34567, r45678, r56789)"
+ "Version 3.22.5.1 (cherry-pick)"
"\" origin/candidates",
"hsh_to_tag"),
Cmd("git tag 3.22.5.1 hsh_to_tag", ""),
@@ -1472,12 +1338,12 @@ LOG=N
Cmd("git branch -D %s" % TEST_CONFIG["BRANCHNAME"], ""),
])
- # r12345 and r34567 are patches. r23456 (included) and r45678 are the MIPS
- # ports of r12345. r56789 is the MIPS port of r34567.
+ # ab12345 and ab34567 are patches. ab23456 (included) and ab45678 are the
+ # MIPS ports of ab12345. ab56789 is the MIPS port of ab34567.
args = ["-f", "-p", extra_patch, "--branch", "candidates",
- "--vc-interface", "git_read_svn_write", "12345", "23456", "34567"]
+ "ab12345", "ab23456", "ab34567"]
- # The first run of the script stops because of the svn being down.
+ # The first run of the script stops because of git being down.
self.assertRaises(GitFailedException,
lambda: MergeToBranch(TEST_CONFIG, self).Run(args))
@@ -1569,7 +1435,9 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
Cmd("git checkout -f hash_234 -- %s" % VERSION_FILE, "",
cb=ResetVersion(3, 1, 1)),
Cmd("git log -1 --format=%B hash_234",
- "Version 3.3.1.1 (merged 12)\n\nReview URL: fake.com\n"),
+ "Version 3.3.1.1 (cherry-pick).\n\n"
+ "Merged abc12.\n\n"
+ "Review URL: fake.com\n"),
Cmd("git log -1 --format=%s hash_234", ""),
Cmd("git svn find-rev hash_234", "234"),
Cmd("git log -1 --format=%ci hash_234", "18:15"),
@@ -1655,7 +1523,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
"3.28.40,master,22624,4567,\r\n"
"3.22.3,candidates,345,3456:4566,\r\n"
"3.21.2,3.21,123,,\r\n"
- "3.3.1.1,3.3,234,,12\r\n")
+ "3.3.1.1,3.3,234,,abc12\r\n")
self.assertEquals(csv, FileToText(csv_output))
expected_json = [
@@ -1718,7 +1586,7 @@ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3456 0039-1c4b
{
"revision": "234",
"revision_git": "hash_234",
- "patches_merged": "12",
+ "patches_merged": "abc12",
"bleeding_edge": "",
"bleeding_edge_git": "",
"version": "3.3.1.1",
« no previous file with comments | « tools/push-to-trunk/releases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698