short = 'Perform a three-way merge with the current patch'),
opt('-b', '--base', args = [argparse.commit],
short = 'Use BASE instead of HEAD when applying the patch'),
+ opt('-p', '--strip', type = 'int', metavar = 'N',
+ short = 'Remove N leading slashes from diff paths (default 1)'),
opt('--reject', action = 'store_true',
short = 'Leave the rejected hunks in corresponding *.rej files')]
crt_patch = crt_series.get_patch(current)
bottom = crt_patch.get_bottom()
git.apply_patch(filename = filename, base = bottom,
- reject = options.reject)
+ strip = options.strip, reject = options.reject)
elif options.base:
git.apply_patch(filename = filename, reject = options.reject,
+ strip = options.strip,
base = git_id(crt_series, options.base))
else:
- git.apply_patch(filename = filename, reject = options.reject)
+ git.apply_patch(filename = filename, strip = options.strip,
+ reject = options.reject)
out.done()