Fix bug entry and quotation marks in merge-to-branch.

This fixes usage of quotation marks inside titles of merged patches.
This also fixes aggregation of empty or "none" BUG entries.

BUG=
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/223463003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20483 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5f3c8a11
...@@ -85,7 +85,7 @@ class GitRecipesMixin(object): ...@@ -85,7 +85,7 @@ class GitRecipesMixin(object):
if format: if format:
args.append("--format=%s" % format) args.append("--format=%s" % format)
if grep: if grep:
args.append("--grep=\"%s\"" % grep) args.append("--grep=\"%s\"" % grep.replace("\"", "\\\""))
if reverse: if reverse:
args.append("--reverse") args.append("--reverse")
if git_hash: if git_hash:
......
...@@ -147,7 +147,7 @@ class FindGitRevisions(Step): ...@@ -147,7 +147,7 @@ class FindGitRevisions(Step):
for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg, for bug in re.findall(r"^[ \t]*BUG[ \t]*=[ \t]*(.*?)[ \t]*$", msg,
re.M): re.M):
bugs.extend(map(lambda s: s.strip(), bug.split(","))) bugs.extend(map(lambda s: s.strip(), bug.split(",")))
bug_aggregate = ",".join(sorted(bugs)) bug_aggregate = ",".join(sorted(filter(lambda s: s and s != "none", bugs)))
if bug_aggregate: if bug_aggregate:
self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate self["new_commit_msg"] += "BUG=%s\nLOG=N\n" % bug_aggregate
......
...@@ -995,7 +995,7 @@ Title3 ...@@ -995,7 +995,7 @@ Title3
Title1 Title1
Title5 Revert "Something"
BUG=123,234,345,456,567,v8:123 BUG=123,234,345,456,567,v8:123
LOG=N LOG=N
...@@ -1043,12 +1043,12 @@ LOG=N ...@@ -1043,12 +1043,12 @@ LOG=N
Git("log -1 --format=%s hash2", "Title2"), Git("log -1 --format=%s hash2", "Title2"),
Git("log -1 --format=%s hash3", "Title3"), Git("log -1 --format=%s hash3", "Title3"),
Git("log -1 --format=%s hash1", "Title1"), Git("log -1 --format=%s hash1", "Title1"),
Git("log -1 --format=%s hash5", "Title5"), Git("log -1 --format=%s hash5", "Revert \"Something\""),
Git("log -1 hash4", "Title4\nBUG=123\nBUG=234"), Git("log -1 hash4", "Title4\nBUG=123\nBUG=234"),
Git("log -1 hash2", "Title2\n BUG = v8:123,345"), Git("log -1 hash2", "Title2\n BUG = v8:123,345"),
Git("log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"), Git("log -1 hash3", "Title3\nLOG=n\nBUG=567, 456"),
Git("log -1 hash1", "Title1"), Git("log -1 hash1", "Title1\nBUG="),
Git("log -1 hash5", "Title5"), Git("log -1 hash5", "Revert \"Something\"\nBUG=none"),
Git("log -1 -p hash4", "patch4"), Git("log -1 -p hash4", "patch4"),
Git("apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE], Git("apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE],
"", cb=VerifyPatch("patch4")), "", cb=VerifyPatch("patch4")),
...@@ -1071,7 +1071,8 @@ LOG=N ...@@ -1071,7 +1071,8 @@ LOG=N
Git("cl presubmit", "Presubmit successfull\n"), Git("cl presubmit", "Presubmit successfull\n"),
Git("cl dcommit -f --bypass-hooks", "Closing issue\n", cb=VerifySVNCommit), Git("cl dcommit -f --bypass-hooks", "Closing issue\n", cb=VerifySVNCommit),
Git("svn fetch", ""), Git("svn fetch", ""),
Git("log -1 --format=%%H --grep=\"%s\" svn/trunk" % msg, "hash6"), Git(("log -1 --format=%%H --grep=\"%s\" svn/trunk"
% msg.replace("\"", "\\\"")), "hash6"),
Git("svn find-rev hash6", "1324"), Git("svn find-rev hash6", "1324"),
Git(("copy -r 1324 https://v8.googlecode.com/svn/trunk " Git(("copy -r 1324 https://v8.googlecode.com/svn/trunk "
"https://v8.googlecode.com/svn/tags/3.22.5.1 -m " "https://v8.googlecode.com/svn/tags/3.22.5.1 -m "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment