diff --git a/AUTHORS b/AUTHORS index 82512c59f..28dbeff41 100644 --- a/AUTHORS +++ b/AUTHORS @@ -128,4 +128,5 @@ suggestions: Najmi Ahmad Zabidi Philipp Woelfel Tuomas Toivola + Adam Gibbins diff --git a/ChangeLog b/ChangeLog index dc7df4c73..fe1cec601 100644 --- a/ChangeLog +++ b/ChangeLog @@ -306,6 +306,8 @@ data. + Fixed problem where update-holidays.pl did not use the YYYYMMDD date foramt. + Fixed problem where urgency was not properly calculated for waiting tasks. + + Fixed problem where 'project' was not supported as a verbosity token (thanks + to Adam Gibbins). ------ old releases ------------------------------ diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 7c69b6d80..56aaaffd7 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -253,6 +253,7 @@ control specific occasions when output is generated. This list may contain: affected Reports 'N tasks affected' and similar edit Used the verbose template for the 'edit' command special Feedback when applying special tags + project Feedback about project status changes Note that the "on" setting is equivalent to all the tokens being specified, and the "off" setting is equivalent to none of the tokens being specified. diff --git a/src/Config.cpp b/src/Config.cpp index 5b806a305..7f9925d4d 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -82,7 +82,7 @@ std::string Config::_defaults = "#verbose=no # Provide regular feedback\n" "#verbose=nothing # Provide no feedback\n" "# # Comma-separated list. May contain any subset of:\n" - "#verbose=blank,header,footnote,label,new-id,affected,edit,special\n" + "#verbose=blank,header,footnote,label,new-id,affected,edit,special,project\n" "confirmation=yes # Confirmation on delete, big changes\n" "annotations=full # Level of verbosity for annotations: full, sparse or none\n" "indent.annotation=2 # Indent spaces for annotations\n" diff --git a/src/Context.cpp b/src/Context.cpp index 91dda7237..09b8b0b6d 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -452,7 +452,8 @@ bool Context::verbose (const std::string& token) verbosity[0] != "new-id" && // verbosity[0] != "affected" && // verbosity[0] != "edit" && // - verbosity[0] != "special") // + verbosity[0] != "special" && // + verbosity[0] != "project") // { verbosity.clear (); @@ -464,6 +465,7 @@ bool Context::verbose (const std::string& token) verbosity.push_back ("affected"); verbosity.push_back ("edit"); verbosity.push_back ("special"); + verbosity.push_back ("project"); } } diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index eec7271dd..866c341c7 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -56,12 +56,11 @@ int CmdAdd::execute (std::string& output) modify_task_description_replace (task, context.a3.extract_modifications ()); context.tdb2.add (task); - // TODO This should be a call in to feedback.cpp. if (context.verbose ("new-id")) output = format (STRING_CMD_ADD_FEEDBACK, context.tdb2.next_id ()) + "\n"; - // TODO verbosity token. - context.footnote (onProjectChange (task)); + if (context.verbose ("project")) + context.footnote (onProjectChange (task)); context.tdb2.commit (); return rc; diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index 9f236955a..6e01212d2 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -84,7 +84,8 @@ int CmdAnnotate::execute (std::string& output) context.tdb2.modify (*task); ++count; feedback_affected (STRING_CMD_ANNO_TASK, *task); - context.footnote (onProjectChange (*task, true)); + if (context.verbose ("project")) + context.footnote (onProjectChange (*task, true)); // Annotate siblings. if (task->has ("parent")) diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index 94977d626..c081a9b8f 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -87,7 +87,8 @@ int CmdAppend::execute (std::string& output) context.tdb2.modify (*task); ++count; feedback_affected (STRING_CMD_APPEND_TASK, *task); - projectChanges[task->get ("project")] = onProjectChange (*task, true); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, true); // Append to siblings. if (task->has ("parent")) diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index 1787a46d6..b3289d6ef 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -102,7 +102,8 @@ int CmdDelete::execute (std::string& output) feedback_affected (STRING_CMD_DELETE_TASK, *task); feedback_unblocked (*task); dependencyChainOnComplete (*task); - projectChanges[task->get ("project")] = onProjectChange (*task, true); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, true); // Delete siblings. if (task->has ("parent")) diff --git a/src/commands/CmdDone.cpp b/src/commands/CmdDone.cpp index bc0568f65..3afeb6f2c 100644 --- a/src/commands/CmdDone.cpp +++ b/src/commands/CmdDone.cpp @@ -103,7 +103,8 @@ int CmdDone::execute (std::string& output) if (!nagged) nagged = nag (*task); dependencyChainOnComplete (*task); - projectChanges[task->get ("project")] = onProjectChange (*task, false); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, false); } else { diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index 7caee03cb..78a354fef 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -117,7 +117,8 @@ int CmdDuplicate::execute (std::string& output) if (context.verbose ("new-id")) std::cout << format (STRING_CMD_ADD_FEEDBACK, context.tdb2.next_id ()) + "\n"; - projectChanges[task->get ("project")] = onProjectChange (*task, false); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, false); } else { diff --git a/src/commands/CmdLog.cpp b/src/commands/CmdLog.cpp index 2cf8392c4..7139dc0a7 100644 --- a/src/commands/CmdLog.cpp +++ b/src/commands/CmdLog.cpp @@ -65,7 +65,8 @@ int CmdLog::execute (std::string& output) throw std::string (STRING_CMD_LOG_NO_WAITING); context.tdb2.add (task); - context.footnote (onProjectChange (task)); + if (context.verbose ("project")) + context.footnote (onProjectChange (task)); context.tdb2.commit (); if (context.verbose ("affected") || diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index c65a50890..99fb43f6e 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -112,7 +112,8 @@ int CmdModify::execute (std::string& output) feedback_affected (STRING_CMD_MODIFY_TASK, *task); feedback_unblocked (*task); context.tdb2.modify (*task); - projectChanges[task->get ("project")] = onProjectChange (before, *task); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (before, *task); // Task potentially has siblings - modify them. if (task->has ("parent")) @@ -132,7 +133,8 @@ int CmdModify::execute (std::string& output) feedback_affected (STRING_CMD_MODIFY_TASK_R, *sibling); feedback_unblocked (*sibling); context.tdb2.modify (*sibling); - projectChanges[sibling->get ("project")] = onProjectChange (alternate, *sibling); + if (context.verbose ("project")) + projectChanges[sibling->get ("project")] = onProjectChange (alternate, *sibling); } } } @@ -152,7 +154,8 @@ int CmdModify::execute (std::string& output) updateRecurrenceMask (*child); context.tdb2.modify (*child); dependencyChainOnModify (alternate, *child); - projectChanges[child->get ("project")] = onProjectChange (alternate, *child); + if (context.verbose ("project")) + projectChanges[child->get ("project")] = onProjectChange (alternate, *child); ++count; feedback_affected (STRING_CMD_MODIFY_TASK_R, *child); } diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index b64466b5b..5c3a523d3 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -87,7 +87,8 @@ int CmdPrepend::execute (std::string& output) context.tdb2.modify (*task); ++count; feedback_affected (STRING_CMD_PREPEND_TASK, *task); - projectChanges[task->get ("project")] = onProjectChange (*task, true); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, true); // Prepend to siblings. if (task->has ("parent")) diff --git a/src/commands/CmdStart.cpp b/src/commands/CmdStart.cpp index 792db843b..6c73e22ca 100644 --- a/src/commands/CmdStart.cpp +++ b/src/commands/CmdStart.cpp @@ -96,7 +96,8 @@ int CmdStart::execute (std::string& output) if (!nagged) nagged = nag (*task); dependencyChainOnStart (*task); - projectChanges[task->get ("project")] = onProjectChange (*task, false); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, false); } else { diff --git a/src/commands/CmdStop.cpp b/src/commands/CmdStop.cpp index 305db994a..16409e7e5 100644 --- a/src/commands/CmdStop.cpp +++ b/src/commands/CmdStop.cpp @@ -92,7 +92,8 @@ int CmdStop::execute (std::string& output) ++count; feedback_affected (STRING_CMD_STOP_TASK, *task); dependencyChainOnStart (*task); - projectChanges[task->get ("project")] = onProjectChange (*task, false); + if (context.verbose ("project")) + projectChanges[task->get ("project")] = onProjectChange (*task, false); } else { diff --git a/test/verbose.t b/test/verbose.t index a02f00f7b..386dad3a2 100755 --- a/test/verbose.t +++ b/test/verbose.t @@ -63,6 +63,7 @@ unlike ($output, qr/ID.+Project.+Pri.+Description/, '\'label\' verbosity good'); # TODO Verbosity: 'header' # TODO Verbosity: 'edit' # TODO Verbosity: 'special' +# TODO Verbosity: 'project' # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data synch.key verbose.rc);