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>
GRun('repack', '-a', '-d', '-f').run()
def apply_patch(filename = None, diff = None, base = None,
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
"""
"""Apply a patch onto the current or given index. There must not
be any local changes in the tree, otherwise the command fails
"""
except GitRunException:
if base:
switch(orig_head)
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',
if base:
top = commit(message = 'temporary commit used for applying a patch',