From a65fe591b824a80dcc8542aca610812a20ce7d1f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 12 Feb 2011 15:08:57 -0500 Subject: [PATCH] Bug #634 - Fixed bug #634, so that 'undo' obeys the 'confirmation' setting (thanks to Steve Rader). --- ChangeLog | 2 ++ doc/man/task.1.in | 2 +- doc/man/taskrc.5.in | 5 +++-- src/TDB.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f60030f14..b097692b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -102,6 +102,8 @@ + Enhanced unit tests in response to bug #624 (thanks to Steve Rader). + Fixed bug #628, where dateformats containing spaces were not properly parsed (thanks to Steve Rader). + + Fixed bug #634, so that 'undo' obeys the 'confirmation' setting (thanks to + Steve Rader). + Fixed bug #641, where certain reports broke when 'dateformat' differed from 'dateformat.report'. + Fixed bug #651, which broke the edit command when a task description diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 9bfb9972c..c65631b24 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -50,7 +50,7 @@ With an ID but no specific command, taskwarrior runs the "info" command. .TP .B undo -Reverts the most recent action. +Reverts the most recent action. Obeys the confirmation setting. .TP .B shell diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 958651fd2..2f204e1bd 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -196,8 +196,9 @@ Controls some of the verbosity of taskwarrior. .TP .B confirmation=yes May be "yes" or "no", and determines whether taskwarrior will ask for -confirmation before deleting a task or doing bulk changes. The default value -is "yes". +confirmation before deleting a task, performing bulk changes, or the undo +command. The default value is "yes". Consider leaving this setting as "no", +for safety. .TP .B echo.command=yes diff --git a/src/TDB.cpp b/src/TDB.cpp index 742769642..32693f0f1 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -999,7 +999,8 @@ void TDB::undo () } // Output displayed, now confirm. - if (!confirm ("The undo command is not reversible. Are you sure you want to revert to the previous state?")) + if (context.config.getBoolean ("confirmation") && + !confirm ("The undo command is not reversible. Are you sure you want to revert to the previous state?")) { std::cout << "No changes made.\n"; context.hooks.trigger ("post-undo");