aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@gmail.com>2009-09-16 14:00:34 +0100
committerCatalin Marinas <catalin.marinas@gmail.com>2009-09-16 14:00:34 +0100
commitb0bff9328fcd6215093995b93673873016a4bf38 (patch)
tree3c903b16732209e38ad9d9311a7cd982dea69662
parentb56d87814e5986a03efa9079d482a5b020141794 (diff)
downloadstgit-b0bff9328fcd6215093995b93673873016a4bf38.tar.gz
Add the --reject option to fold
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
-rw-r--r--stgit/commands/fold.py11
1 files changed, 7 insertions, 4 deletions
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()