chiark / gitweb /
Remove the 'fail_dump' argument to git.apply_patch()
authorCatalin Marinas <catalin.marinas@gmail.com>
Wed, 16 Sep 2009 12:59:47 +0000 (13:59 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 16 Sep 2009 12:59:47 +0000 (13:59 +0100)
Since we have a 'reject' argument, there is no need for the failed diff
to be dumped.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/git.py

index 012e2826d6b62c45bc6dae288ba0c7679dbb7070..97b1e96202628f1769adc3cbf11a4fc7c1f6fdb1 100644 (file)
@@ -818,7 +818,7 @@ def repack():
     GRun('repack', '-a', '-d', '-f').run()
 
 def apply_patch(filename = None, diff = None, base = None,
-                fail_dump = True, reject = False, strip = None):
+                reject = False, strip = None):
     """Apply a patch onto the current or given index. There must not
     be any local changes in the tree, otherwise the command fails
     """
@@ -847,14 +847,7 @@ def apply_patch(filename = None, diff = None, base = None,
     except GitRunException:
         if base:
             switch(orig_head)
-        if fail_dump:
-            # write the failed diff to a file
-            f = file('.stgit-failed.patch', 'w+')
-            f.write(diff)
-            f.close()
-            out.warn('Diff written to the .stgit-failed.patch file')
-
-        raise
+        raise GitException('Diff does not apply cleanly')
 
     if base:
         top = commit(message = 'temporary commit used for applying a patch',