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 f3db73ecfa2adfde847c15468e4c4f7f0667d0ee..92aabf649296d1cfc3eb92942f6792818b2647ff 100644 |
--- a/tools/push-to-trunk/test_scripts.py |
+++ b/tools/push-to-trunk/test_scripts.py |
@@ -459,21 +459,21 @@ class ScriptTest(unittest.TestCase): |
TEST_CONFIG[CHANGELOG_ENTRY_FILE] = self.MakeEmptyTempFile() |
self.ExpectGit([ |
- ["log 1234..HEAD --format=%H", "rev1\nrev2\nrev3\nrev4"], |
- ["log -1 rev1 --format=\"%s\"", "Title text 1"], |
- ["log -1 rev1 --format=\"%B\"", "Title\n\nBUG=\nLOG=y\n"], |
- ["log -1 rev1 --format=\"%an\"", "author1@chromium.org"], |
- ["log -1 rev2 --format=\"%s\"", "Title text 2."], |
- ["log -1 rev2 --format=\"%B\"", "Title\n\nBUG=123\nLOG= \n"], |
- ["log -1 rev2 --format=\"%an\"", "author2@chromium.org"], |
- ["log -1 rev3 --format=\"%s\"", "Title text 3"], |
- ["log -1 rev3 --format=\"%B\"", "Title\n\nBUG=321\nLOG=true\n"], |
- ["log -1 rev3 --format=\"%an\"", "author3@chromium.org"], |
- ["log -1 rev4 --format=\"%s\"", "Title text 4"], |
- ["log -1 rev4 --format=\"%B\"", |
+ ["log --format=%H 1234..HEAD", "rev1\nrev2\nrev3\nrev4"], |
+ ["log -1 --format=%s rev1", "Title text 1"], |
+ ["log -1 --format=%B rev1", "Title\n\nBUG=\nLOG=y\n"], |
+ ["log -1 --format=%an rev1", "author1@chromium.org"], |
+ ["log -1 --format=%s rev2", "Title text 2."], |
+ ["log -1 --format=%B rev2", "Title\n\nBUG=123\nLOG= \n"], |
+ ["log -1 --format=%an rev2", "author2@chromium.org"], |
+ ["log -1 --format=%s rev3", "Title text 3"], |
+ ["log -1 --format=%B rev3", "Title\n\nBUG=321\nLOG=true\n"], |
+ ["log -1 --format=%an rev3", "author3@chromium.org"], |
+ ["log -1 --format=%s rev4", "Title text 4"], |
+ ["log -1 --format=%B rev4", |
("Title\n\nBUG=456\nLOG=Y\n\n" |
"Review URL: https://codereview.chromium.org/9876543210\n")], |
- ["log -1 rev4 --format=\"%an\"", "author4@chromium.org"], |
+ ["log -1 --format=%an rev4", "author4@chromium.org"], |
]) |
# The cl for rev4 on rietveld has an updated LOG flag. |
@@ -675,41 +675,41 @@ Performance and stability improvements on all platforms.""", commit) |
["log -1 --format=%s hash2", |
"Version 3.4.5 (based on bleeding_edge revision r1234)\n"], |
["svn find-rev r1234", "hash3\n"], |
- ["log hash3..HEAD --format=%H", "rev1\n"], |
- ["log -1 rev1 --format=\"%s\"", "Log text 1.\n"], |
- ["log -1 rev1 --format=\"%B\"", "Text\nLOG=YES\nBUG=v8:321\nText\n"], |
- ["log -1 rev1 --format=\"%an\"", "author1@chromium.org\n"], |
- [("commit -a -m \"Prepare push to trunk. " |
+ ["log --format=%H hash3..HEAD", "rev1\n"], |
+ ["log -1 --format=%s rev1", "Log text 1.\n"], |
+ ["log -1 --format=%B rev1", "Text\nLOG=YES\nBUG=v8:321\nText\n"], |
+ ["log -1 --format=%an rev1", "author1@chromium.org\n"], |
+ [("commit -am \"Prepare push to trunk. " |
"Now working on version 3.22.6.%s\"" % review_suffix), |
" 2 files changed\n", |
CheckPreparePush], |
- [("cl upload --email \"author@chromium.org\" " |
- "-r \"reviewer@chromium.org\" --send-mail%s" % force_flag), |
+ [("cl upload --send-mail --email \"author@chromium.org\" " |
+ "-r \"reviewer@chromium.org\"%s" % force_flag), |
"done\n"], |
["cl presubmit", "Presubmit successfull\n"], |
["cl dcommit -f --bypass-hooks", "Closing issue\n"], |
["svn fetch", "fetch result\n"], |
- ["checkout svn/bleeding_edge", ""], |
+ ["checkout -f svn/bleeding_edge", ""], |
[("log -1 --format=%H --grep=\"Prepare push to trunk. " |
"Now working on version 3.22.6.\""), |
"hash1\n"], |
["diff svn/trunk hash1", "patch content\n"], |
["svn find-rev hash1", "123455\n"], |
["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""], |
["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""], |
- ["commit -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit], |
+ ["commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], "", CheckSVNCommit], |
["svn dcommit 2>&1", "Some output\nCommitted r123456\nSome output\n"], |
["svn tag 3.22.5 -m \"Tagging version 3.22.5\"", ""], |
["status -s -uno", ""], |
- ["checkout master", ""], |
+ ["checkout -f master", ""], |
["pull", ""], |
["checkout -b v8-roll-123456", ""], |
[("commit -am \"Update V8 to version 3.22.5 " |
"(based on bleeding_edge revision r123455).\n\n" |
"TBR=reviewer@chromium.org\""), |
""], |
- ["cl upload --email \"author@chromium.org\" --send-mail%s" % force_flag, |
+ ["cl upload --send-mail --email \"author@chromium.org\"%s" % force_flag, |
""], |
["checkout -f some_branch", ""], |
["branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""], |
@@ -896,27 +896,27 @@ LOG=N |
["checkout -b %s" % TEST_CONFIG[TEMP_BRANCH], ""], |
["branch", " branch1\n* branch2\n"], |
["checkout -b %s svn/trunk" % TEST_CONFIG[BRANCHNAME], ""], |
- ["log svn/bleeding_edge --reverse --format=%H --grep=\"Port r12345\"", |
+ ["log --format=%H --grep=\"Port r12345\" --reverse svn/bleeding_edge", |
"hash1\nhash2"], |
["svn find-rev hash1 svn/bleeding_edge", "45678"], |
["log -1 --format=%s hash1", "Title1"], |
["svn find-rev hash2 svn/bleeding_edge", "23456"], |
["log -1 --format=%s hash2", "Title2"], |
- ["log svn/bleeding_edge --reverse --format=%H --grep=\"Port r23456\"", |
+ ["log --format=%H --grep=\"Port r23456\" --reverse svn/bleeding_edge", |
""], |
- ["log svn/bleeding_edge --reverse --format=%H --grep=\"Port r34567\"", |
+ ["log --format=%H --grep=\"Port r34567\" --reverse svn/bleeding_edge", |
"hash3"], |
["svn find-rev hash3 svn/bleeding_edge", "56789"], |
["log -1 --format=%s hash3", "Title3"], |
- ["svn find-rev \"r12345\" svn/bleeding_edge", "hash4"], |
+ ["svn find-rev r12345 svn/bleeding_edge", "hash4"], |
# Simulate svn being down which stops the script. |
- ["svn find-rev \"r23456\" svn/bleeding_edge", None], |
+ ["svn find-rev r23456 svn/bleeding_edge", None], |
# Restart script in the failing step. |
- ["svn find-rev \"r12345\" svn/bleeding_edge", "hash4"], |
- ["svn find-rev \"r23456\" svn/bleeding_edge", "hash2"], |
- ["svn find-rev \"r34567\" svn/bleeding_edge", "hash3"], |
- ["svn find-rev \"r45678\" svn/bleeding_edge", "hash1"], |
- ["svn find-rev \"r56789\" svn/bleeding_edge", "hash5"], |
+ ["svn find-rev r12345 svn/bleeding_edge", "hash4"], |
+ ["svn find-rev r23456 svn/bleeding_edge", "hash2"], |
+ ["svn find-rev r34567 svn/bleeding_edge", "hash3"], |
+ ["svn find-rev r45678 svn/bleeding_edge", "hash1"], |
+ ["svn find-rev r56789 svn/bleeding_edge", "hash5"], |
["log -1 --format=%s hash4", "Title4"], |
["log -1 --format=%s hash2", "Title2"], |
["log -1 --format=%s hash3", "Title3"], |
@@ -928,24 +928,24 @@ LOG=N |
["log -1 hash1", "Title1"], |
["log -1 hash5", "Title5"], |
["log -1 -p hash4", "patch4"], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
"", VerifyPatch("patch4")], |
["log -1 -p hash2", "patch2"], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
"", VerifyPatch("patch2")], |
["log -1 -p hash3", "patch3"], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
"", VerifyPatch("patch3")], |
["log -1 -p hash1", "patch1"], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
"", VerifyPatch("patch1")], |
["log -1 -p hash5", "patch5"], |
- ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
+ ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], |
"", VerifyPatch("patch5")], |
- ["apply --index --reject \"%s\"" % extra_patch, ""], |
- ["commit -a -F \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], ""], |
- ["cl upload -r \"reviewer@chromium.org\" --send-mail", ""], |
- ["checkout %s" % TEST_CONFIG[BRANCHNAME], ""], |
+ ["apply --index --reject \"%s\"" % extra_patch, ""], |
+ ["commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], ""], |
+ ["cl upload --send-mail -r \"reviewer@chromium.org\"", ""], |
+ ["checkout -f %s" % TEST_CONFIG[BRANCHNAME], ""], |
["cl presubmit", "Presubmit successfull\n"], |
["cl dcommit -f --bypass-hooks", "Closing issue\n", VerifySVNCommit], |
["svn fetch", ""], |
@@ -973,7 +973,7 @@ LOG=N |
self.assertTrue(merge_to_branch.ProcessOptions(options, args)) |
# The first run of the script stops because of the svn being down. |
- self.assertRaises(Exception, |
+ self.assertRaises(GitFailedException, |
lambda: RunMergeToBranch(TEST_CONFIG, |
MergeToBranchOptions(options, args), |
self)) |