Reviewers: jarin,

Message:
PTAL


https://codereview.chromium.org/197023004/diff/1/tools/push-to-trunk/git_recipes.py
File tools/push-to-trunk/git_recipes.py (right):

https://codereview.chromium.org/197023004/diff/1/tools/push-to-trunk/git_recipes.py#newcode135
tools/push-to-trunk/git_recipes.py:135:
I hope this approach has no potential for omitting any required files. I
could not find an innate "exclude" feature in git diff.

Description:
Add file exclusion to trunk patch creation in push-to-trunk.

This is another step towards getting rid of the bleeding edge change log file.
Now it can be omitted in a follow up CL.

Please review this at https://codereview.chromium.org/197023004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+9, -4 lines):
  M tools/push-to-trunk/git_recipes.py
  M tools/push-to-trunk/test_scripts.py


Index: tools/push-to-trunk/git_recipes.py
diff --git a/tools/push-to-trunk/git_recipes.py b/tools/push-to-trunk/git_recipes.py index fb7424f709478885ed5142d2dbb4c467f92b8222..e8e81fc98cbf1732a97c468734a5c60b74e3d94b 100644
--- a/tools/push-to-trunk/git_recipes.py
+++ b/tools/push-to-trunk/git_recipes.py
@@ -133,8 +133,11 @@ class GitRecipesMixin(object):
   def GitDCommit(self):
     self.Git("cl dcommit -f --bypass-hooks", retry_on=lambda x: x is None)

-  def GitDiff(self, loc1, loc2):
-    return self.Git(MakeArgs(["diff", loc1, loc2]))
+  def GitDiff(self, loc1, loc2, exclude=None):
+    exclude = exclude or []
+    files = self.Git(MakeArgs(["diff", "--name-only", loc1, loc2]))
+    files = filter(lambda f: f not in exclude, files.strip().splitlines())
+    return self.Git(MakeArgs(["diff", loc1, loc2] + files))

   def GitPull(self):
     self.Git("pull")
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 112efdfe29a47caf40bf1b62b6072146bb751dd5..207cac45e8531584fb233430b0264e146fd452b0 100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -589,7 +589,8 @@ class ScriptTest(unittest.TestCase):
       f.write(change_log)

     self.ExpectGit([
-      Git("diff svn/trunk hash1", "patch content"),
+      Git("diff --name-only svn/trunk hash1", "file1\nfile2\n"),
+      Git("diff svn/trunk hash1 file1 file2", "patch content"),
       Git("svn find-rev hash1", "123455\n"),
     ])

@@ -710,7 +711,8 @@ Performance and stability improvements on all platforms.""", commit)
       Git(("log -1 --format=%H --grep=\"Prepare push to trunk.  "
            "Now working on version 3.22.6.\""),
           "hash1\n"),
-      Git("diff svn/trunk hash1", "patch content\n"),
+      Git("diff --name-only svn/trunk hash1", "file1\nfile2\n"),
+      Git("diff svn/trunk hash1 file1 file2", "patch content"),
       Git("svn find-rev hash1", "123455\n"),
       Git("checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""),
       Git("apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""),


--
--
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/d/optout.

Reply via email to