Revision: 19566
Author:   [email protected]
Date:     Wed Feb 26 16:12:32 2014 UTC
Log:      Fix patch creation in merge-to-branch script.

Patch white space got stripped, which lead to failures when applying the patch.

- Refine test to reveal the problem
- Create a separate method for retrieving the patch that doesn't strip white space

[email protected]

Review URL: https://codereview.chromium.org/181603002
http://code.google.com/p/v8/source/detail?r=19566

Modified:
 /branches/bleeding_edge/tools/push-to-trunk/git_recipes.py
 /branches/bleeding_edge/tools/push-to-trunk/merge_to_branch.py
 /branches/bleeding_edge/tools/push-to-trunk/test_scripts.py

=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/git_recipes.py Thu Feb 20 16:39:41 2014 UTC +++ /branches/bleeding_edge/tools/push-to-trunk/git_recipes.py Wed Feb 26 16:12:32 2014 UTC
@@ -72,7 +72,7 @@

   @Strip
   def GitLog(self, n=0, format="", grep="", git_hash="", parent_hash="",
-             branch="", reverse=False, patch=False):
+             branch="", reverse=False):
     assert not (git_hash and parent_hash)
     args = ["log"]
     if n > 0:
@@ -83,8 +83,6 @@
       args.append("--grep=\"%s\"" % grep)
     if reverse:
       args.append("--reverse")
-    if patch:
-      args.append("-p")
     if git_hash:
       args.append(git_hash)
     if parent_hash:
@@ -92,6 +90,10 @@
     args.append(branch)
     return self.Git(MakeArgs(args))

+  def GitGetPatch(self, git_hash):
+    assert git_hash
+    return self.Git(MakeArgs(["log", "-1", "-p", git_hash]))
+
   def GitAdd(self, name):
     assert name
     self.Git(MakeArgs(["add", Quoted(name)]))
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/merge_to_branch.py Wed Feb 26 15:13:31 2014 UTC +++ /branches/bleeding_edge/tools/push-to-trunk/merge_to_branch.py Wed Feb 26 16:12:32 2014 UTC
@@ -182,7 +182,7 @@
     for commit_hash in self["patch_commit_hashes"]:
       print("Applying patch for %s to %s..."
             % (commit_hash, self["merge_to_branch"]))
-      patch = self.GitLog(n=1, patch=True, git_hash=commit_hash)
+      patch = self.GitGetPatch(commit_hash)
       TextToFile(patch, self.Config(TEMPORARY_PATCH_FILE))
self.ApplyPatch(self.Config(TEMPORARY_PATCH_FILE), self._options.revert)
     if self._options.patch:
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/test_scripts.py Wed Feb 26 15:13:31 2014 UTC +++ /branches/bleeding_edge/tools/push-to-trunk/test_scripts.py Wed Feb 26 16:12:32 2014 UTC
@@ -950,9 +950,9 @@
       ["log -1 -p hash1", "patch1"],
       ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE],
        "", VerifyPatch("patch1")],
-      ["log -1 -p hash5", "patch5"],
+      ["log -1 -p hash5", "patch5\n"],
       ["apply --index --reject \"%s\"" % TEST_CONFIG[TEMPORARY_PATCH_FILE],
-       "", VerifyPatch("patch5")],
+       "", VerifyPatch("patch5\n")],
       ["apply --index --reject \"%s\"" % extra_patch, ""],
       ["commit -aF \"%s\"" % TEST_CONFIG[COMMITMSG_FILE], ""],
       ["cl upload --send-mail -r \"[email protected]\"", ""],

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to