From 034db15c1443a01ed1333eaa2f41c1b74adef6bb Mon Sep 17 00:00:00 2001 Message-Id: <034db15c1443a01ed1333eaa2f41c1b74adef6bb.1746213595.git.mdw@distorted.org.uk> From: Mark Wooding Date: Tue, 6 Jun 2006 19:15:13 +0100 Subject: [PATCH] Add the --replace option to import Organization: Straylight/Edgeware From: Catalin Marinas 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 --- stgit/commands/imprt.py | 6 ++++++ 1 file changed, 6 insertions(+) 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, -- [mdw]