Updated Branches:
  refs/heads/FLUME-1787 04fe3586e -> 7e15f5d68

git apply: Ensure output file exists


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/7e15f5d6
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/7e15f5d6
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/7e15f5d6

Branch: refs/heads/FLUME-1787
Commit: 7e15f5d6832175fe7a9ae01e396d0c2627aeab82
Parents: 04fe358
Author: Brock Noland <[email protected]>
Authored: Thu Dec 20 14:49:46 2012 -0600
Committer: Brock Noland <[email protected]>
Committed: Thu Dec 20 14:49:46 2012 -0600

----------------------------------------------------------------------
 dev-support/test-patch.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/7e15f5d6/dev-support/test-patch.py
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py
index 256c05a..ab13602 100755
--- a/dev-support/test-patch.py
+++ b/dev-support/test-patch.py
@@ -120,8 +120,10 @@ def git_checkout(result, branch):
 def git_apply(result, cmd, patch_file, strip, output_dir):
   output_file = "%s/apply.txt" % (output_dir)
   rc = execute("%s -p%s < %s 1>%s 2>&1" % (cmd, strip, patch_file, 
output_file))
-  with open(output_file) as fh:
-    output = fh.read()
+  output = ""
+  if os.path.exists(output_file):
+    with open(output_file) as fh:
+      output = fh.read()
   if rc == 0:
     if output:
       print output

Reply via email to