Add script to apply a patch from rietveld.

At the moment it just fetches the patch. It's still useful to debug rietveld
issues.

Improve resiliency to invalid patches.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@81305 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/patch.py b/patch.py
index 18c16e2..f6b19ac 100644
--- a/patch.py
+++ b/patch.py
@@ -89,6 +89,8 @@
 
   def __init__(self, filename, diff, svn_properties):
     super(FilePatchDiff, self).__init__(filename)
+    if not diff:
+      self._fail('File doesn\'t have a diff.')
     self.diff_header, self.diff_hunks = self._split_header(diff)
     self.svn_properties = svn_properties or []
     self.is_git_diff = self._is_git_diff_header(self.diff_header)