Add post_process argument to Checkout.apply_patch().

This enables doing late modifications like updating the copyright notice or fixing line endings.

Also silence the checkout operations a bit more when VOID=subprocess2.VOID.

Add corresponding unit tests.

Review URL: http://codereview.chromium.org/6891003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@82587 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/patch.py b/patch.py
index 316333f..bac992d 100644
--- a/patch.py
+++ b/patch.py
@@ -273,6 +273,8 @@
 
   def __init__(self, patches):
     self.patches = patches
+    for p in self.patches:
+      assert isinstance(p, FilePatchBase)
 
   def set_relpath(self, relpath):
     """Used to offset the patch into a subdirectory."""