From: Catalin Marinas Date: Tue, 6 Jun 2006 18:15:13 +0000 (+0100) Subject: Add the --replace option to import X-Git-Tag: v0.14.3~485 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/034db15c1443a01ed1333eaa2f41c1b74adef6bb Add the --replace option to import By default, import fails if an existing patch is found with the same name. With this option, import replaces the existing patch if it is unapplied. Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/imprt.py b/stgit/commands/imprt.py index fcbe9d3..cfbf0de 100644 --- a/stgit/commands/imprt.py +++ b/stgit/commands/imprt.py @@ -50,6 +50,9 @@ options = [make_option('-m', '--mail', make_option('-i', '--ignore', help = 'ignore the applied patches in the series', action = 'store_true'), + make_option('--replace', + help = 'replace the unapplied patches in the series', + action = 'store_true'), make_option('-b', '--base', help = 'use BASE instead of HEAD for file importing'), make_option('-e', '--edit', @@ -248,6 +251,9 @@ def __import_patch(patch, filename, options): if options.commemail: committer_email = options.commemail + if options.replace and patch in crt_series.get_unapplied(): + crt_series.delete_patch(patch) + crt_series.new_patch(patch, message = message, can_edit = False, author_name = author_name, author_email = author_email,