diff --git a/ChangeLog b/ChangeLog index 2dfc1d555..778678f91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -176,6 +176,8 @@ - TW-1434 Parser issue in description.contains (thanks to Ralph Bean). - TW-1436 Parser hangs when multiple slashes are used. - TW-1437 taskd.trust has a bad default value. +- TW-1438 Configuration setting rc.confirmation=no no longer disables + confirmation requests (thanks to Adam Coddington). - TW-1441 task import continues happily if filename doesn't exist. - TW-1444 Tag ordering is preserved, but should be sorted in reports. - Removed deprecated 'echo.command' setting, in favor of the 'header' and diff --git a/NEWS b/NEWS index 56ad48f7e..850464ec0 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,8 @@ New configuration options in taskwarrior 2.4.0 - New 'color.label.sort' is used to color the column label of sort columns. - New 'urgency.uda..' allows specific UDA values to affect urgency. + - New 'recurrence.confirmation' which allows bypassing confirmation for + changes to recurring tasks, by accepting them. Newly deprecated features in taskwarrior 2.4.0 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index e644ad454..aad1f23d1 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -408,6 +408,11 @@ The character or string to show in the tag.indicator column. Defaults to +. .B dependency.indicator=D The character or string to show in the depends.indicator column. Defaults to +. +.TP +.B recurrence.confirmation=yes +Controls whether changes to recurring tasks propagates to other child tasks with +or without confirmation. Defaults to yes. + .TP .B recurrence.indicator=R The character or string to show in the recurrence_indicator column. Defaults to R. diff --git a/src/Config.cpp b/src/Config.cpp index c03f9a5df..4ccb4bb8b 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -82,6 +82,7 @@ std::string Config::_defaults = "# # Comma-separated list. May contain any subset of:\n" "#verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,filter\n" "confirmation=yes # Confirmation on delete, big changes\n" + "recurrence.confirmation=yes # Confirmation for propagating changes among recurring tasks\n" "allow.empty.filter=yes # An empty filter gets a warning and requires confirmation\n" "indent.annotation=2 # Indent spaces for annotations\n" "indent.report=0 # Indent spaces for whole report\n" diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index 638fefaee..f1e5a20d5 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -90,7 +90,8 @@ int CmdAnnotate::execute (std::string& output) // Annotate siblings. if (task->has ("parent")) { - if (confirm (STRING_CMD_ANNO_CONFIRM_R)) + if (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_ANNO_CONFIRM_R)) { std::vector siblings = context.tdb2.siblings (*task); std::vector ::iterator sibling; diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index 241ad4d52..0f8cdac30 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -90,7 +90,8 @@ int CmdAppend::execute (std::string& output) // Append to siblings. if (task->has ("parent")) { - if (confirm (STRING_CMD_APPEND_CONFIRM_R)) + if (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_APPEND_CONFIRM_R)) { std::vector siblings = context.tdb2.siblings (*task); std::vector ::iterator sibling; diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index 178ddf5ce..a4bc44a9b 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -103,7 +103,8 @@ int CmdDelete::execute (std::string& output) // Delete siblings. if (task->has ("parent")) { - if (confirm (STRING_CMD_DELETE_CONFIRM_R)) + if (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_DELETE_CONFIRM_R)) { std::vector siblings = context.tdb2.siblings (*task); std::vector ::iterator sibling; @@ -137,7 +138,8 @@ int CmdDelete::execute (std::string& output) { std::vector children = context.tdb2.children (*task); if (children.size () && - confirm (STRING_CMD_DELETE_CONFIRM_R)) + (context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_DELETE_CONFIRM_R))) { std::vector ::iterator child; for (child = children.begin (); child != children.end (); ++child) diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index 614fe369c..6d6098947 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -117,7 +117,8 @@ int CmdModify::execute (std::string& output) // Task potentially has siblings - modify them. if (task->has ("parent")) { - if (confirm (STRING_CMD_MODIFY_RECUR)) + if (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_MODIFY_RECUR)) { std::vector siblings = context.tdb2.siblings (*task); std::vector ::iterator sibling; @@ -148,7 +149,8 @@ int CmdModify::execute (std::string& output) { std::vector children = context.tdb2.children (*task); if (children.size () && - confirm (STRING_CMD_MODIFY_RECUR)) + (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_MODIFY_RECUR))) { std::vector ::iterator child; for (child = children.begin (); child != children.end (); ++child) diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index 9d992cf39..a924b1aaf 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -90,7 +90,8 @@ int CmdPrepend::execute (std::string& output) // Prepend to siblings. if (task->has ("parent")) { - if (confirm (STRING_CMD_PREPEND_CONFIRM_R)) + if (! context.config.getBoolean ("recurrence.confirmation") || + confirm (STRING_CMD_PREPEND_CONFIRM_R)) { std::vector siblings = context.tdb2.siblings (*task); std::vector ::iterator sibling; diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index f3c0f0a0f..31ea05ac0 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -171,6 +171,7 @@ int CmdShow::execute (std::string& output) " monthsperline" " nag" " print.empty.columns" + " recurrence.confirmation" " recurrence.indicator" " recurrence.limit" " regex" diff --git a/test/tw-1438.t b/test/tw-1438.t index 22f5f3d73..f3068c67f 100755 --- a/test/tw-1438.t +++ b/test/tw-1438.t @@ -23,7 +23,7 @@ class TestBug1438(TestCase): code, out, err = self.t(("list",)) self.assertIn("Sometimes", out) - command = ("rc.confirmation=off", "2", "mod", "/Sometimes/Everytime/") + command = ("rc.confirmation=off", "rc.recurrence.confirmation=off", "2", "mod", "/Sometimes/Everytime/") code, out, err = self.t(command) self.assertIn("Modified 1 task", out) code, out, err = self.t(("list",))