From: Catalin Marinas Date: Wed, 16 Sep 2009 13:00:34 +0000 (+0100) Subject: Add the --reject option to fold X-Git-Tag: v0.15-rc4~12 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/b0bff9328fcd6215093995b93673873016a4bf38 Add the --reject option to fold Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/fold.py b/stgit/commands/fold.py index 66a2dd9..28e824c 100644 --- a/stgit/commands/fold.py +++ b/stgit/commands/fold.py @@ -38,7 +38,9 @@ options = [ opt('-t', '--threeway', action = 'store_true', short = 'Perform a three-way merge with the current patch'), opt('-b', '--base', args = [argparse.commit], - short = 'Use BASE instead of HEAD applying the patch')] + short = 'Use BASE instead of HEAD when applying the patch'), + opt('--reject', action = 'store_true', + short = 'Leave the rejected hunks in corresponding *.rej files')] directory = DirectoryHasRepository(log = True) @@ -72,11 +74,12 @@ def func(parser, options, args): if options.threeway: crt_patch = crt_series.get_patch(current) bottom = crt_patch.get_bottom() - git.apply_patch(filename = filename, base = bottom) + git.apply_patch(filename = filename, base = bottom, + reject = options.reject) elif options.base: - git.apply_patch(filename = filename, + git.apply_patch(filename = filename, reject = options.reject, base = git_id(crt_series, options.base)) else: - git.apply_patch(filename = filename) + git.apply_patch(filename = filename, reject = options.reject) out.done()