- TW-1438 Configuration setting rc.confirmation=no no longer disables
          confirmation requests (thanks to Adam Coddington).
This commit is contained in:
Paul Beckingham 2014-11-10 20:05:28 -05:00
parent fd518e3fce
commit 9936157704
11 changed files with 26 additions and 8 deletions

View file

@ -176,6 +176,8 @@
- TW-1434 Parser issue in description.contains (thanks to Ralph Bean). - TW-1434 Parser issue in description.contains (thanks to Ralph Bean).
- TW-1436 Parser hangs when multiple slashes are used. - TW-1436 Parser hangs when multiple slashes are used.
- TW-1437 taskd.trust has a bad default value. - 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-1441 task import continues happily if filename doesn't exist.
- TW-1444 Tag ordering is preserved, but should be sorted in reports. - TW-1444 Tag ordering is preserved, but should be sorted in reports.
- Removed deprecated 'echo.command' setting, in favor of the 'header' and - Removed deprecated 'echo.command' setting, in favor of the 'header' and

2
NEWS
View file

@ -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 'color.label.sort' is used to color the column label of sort columns.
- New 'urgency.uda.<name>.<value>' allows specific UDA values to affect - New 'urgency.uda.<name>.<value>' allows specific UDA values to affect
urgency. urgency.
- New 'recurrence.confirmation' which allows bypassing confirmation for
changes to recurring tasks, by accepting them.
Newly deprecated features in taskwarrior 2.4.0 Newly deprecated features in taskwarrior 2.4.0

View file

@ -408,6 +408,11 @@ The character or string to show in the tag.indicator column. Defaults to +.
.B dependency.indicator=D .B dependency.indicator=D
The character or string to show in the depends.indicator column. Defaults to +. 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 .TP
.B recurrence.indicator=R .B recurrence.indicator=R
The character or string to show in the recurrence_indicator column. Defaults to R. The character or string to show in the recurrence_indicator column. Defaults to R.

View file

@ -82,6 +82,7 @@ std::string Config::_defaults =
"# # Comma-separated list. May contain any subset of:\n" "# # 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" "#verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,filter\n"
"confirmation=yes # Confirmation on delete, big changes\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" "allow.empty.filter=yes # An empty filter gets a warning and requires confirmation\n"
"indent.annotation=2 # Indent spaces for annotations\n" "indent.annotation=2 # Indent spaces for annotations\n"
"indent.report=0 # Indent spaces for whole report\n" "indent.report=0 # Indent spaces for whole report\n"

View file

@ -90,7 +90,8 @@ int CmdAnnotate::execute (std::string& output)
// Annotate siblings. // Annotate siblings.
if (task->has ("parent")) 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 <Task> siblings = context.tdb2.siblings (*task); std::vector <Task> siblings = context.tdb2.siblings (*task);
std::vector <Task>::iterator sibling; std::vector <Task>::iterator sibling;

View file

@ -90,7 +90,8 @@ int CmdAppend::execute (std::string& output)
// Append to siblings. // Append to siblings.
if (task->has ("parent")) 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 <Task> siblings = context.tdb2.siblings (*task); std::vector <Task> siblings = context.tdb2.siblings (*task);
std::vector <Task>::iterator sibling; std::vector <Task>::iterator sibling;

View file

@ -103,7 +103,8 @@ int CmdDelete::execute (std::string& output)
// Delete siblings. // Delete siblings.
if (task->has ("parent")) 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 <Task> siblings = context.tdb2.siblings (*task); std::vector <Task> siblings = context.tdb2.siblings (*task);
std::vector <Task>::iterator sibling; std::vector <Task>::iterator sibling;
@ -137,7 +138,8 @@ int CmdDelete::execute (std::string& output)
{ {
std::vector <Task> children = context.tdb2.children (*task); std::vector <Task> children = context.tdb2.children (*task);
if (children.size () && if (children.size () &&
confirm (STRING_CMD_DELETE_CONFIRM_R)) (context.config.getBoolean ("recurrence.confirmation") ||
confirm (STRING_CMD_DELETE_CONFIRM_R)))
{ {
std::vector <Task>::iterator child; std::vector <Task>::iterator child;
for (child = children.begin (); child != children.end (); ++child) for (child = children.begin (); child != children.end (); ++child)

View file

@ -117,7 +117,8 @@ int CmdModify::execute (std::string& output)
// Task potentially has siblings - modify them. // Task potentially has siblings - modify them.
if (task->has ("parent")) if (task->has ("parent"))
{ {
if (confirm (STRING_CMD_MODIFY_RECUR)) if (! context.config.getBoolean ("recurrence.confirmation") ||
confirm (STRING_CMD_MODIFY_RECUR))
{ {
std::vector <Task> siblings = context.tdb2.siblings (*task); std::vector <Task> siblings = context.tdb2.siblings (*task);
std::vector <Task>::iterator sibling; std::vector <Task>::iterator sibling;
@ -148,7 +149,8 @@ int CmdModify::execute (std::string& output)
{ {
std::vector <Task> children = context.tdb2.children (*task); std::vector <Task> children = context.tdb2.children (*task);
if (children.size () && if (children.size () &&
confirm (STRING_CMD_MODIFY_RECUR)) (! context.config.getBoolean ("recurrence.confirmation") ||
confirm (STRING_CMD_MODIFY_RECUR)))
{ {
std::vector <Task>::iterator child; std::vector <Task>::iterator child;
for (child = children.begin (); child != children.end (); ++child) for (child = children.begin (); child != children.end (); ++child)

View file

@ -90,7 +90,8 @@ int CmdPrepend::execute (std::string& output)
// Prepend to siblings. // Prepend to siblings.
if (task->has ("parent")) 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 <Task> siblings = context.tdb2.siblings (*task); std::vector <Task> siblings = context.tdb2.siblings (*task);
std::vector <Task>::iterator sibling; std::vector <Task>::iterator sibling;

View file

@ -171,6 +171,7 @@ int CmdShow::execute (std::string& output)
" monthsperline" " monthsperline"
" nag" " nag"
" print.empty.columns" " print.empty.columns"
" recurrence.confirmation"
" recurrence.indicator" " recurrence.indicator"
" recurrence.limit" " recurrence.limit"
" regex" " regex"

View file

@ -23,7 +23,7 @@ class TestBug1438(TestCase):
code, out, err = self.t(("list",)) code, out, err = self.t(("list",))
self.assertIn("Sometimes", out) 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) code, out, err = self.t(command)
self.assertIn("Modified 1 task", out) self.assertIn("Modified 1 task", out)
code, out, err = self.t(("list",)) code, out, err = self.t(("list",))