mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature #725
- Added feature #725, which provides feedback when tasks become unblocked. - Added unit tests.
This commit is contained in:
parent
56f0281ab1
commit
9d74b55d48
7 changed files with 56 additions and 6 deletions
|
@ -365,4 +365,45 @@ void feedback_special_tags (const Task& task, const std::string& tag)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Called on completion, deletion and update. If this task is blocking another
|
||||
// task, then if this was the *only* blocking task, that other task is now
|
||||
// unblocked. Mention it.
|
||||
//
|
||||
// Implements:
|
||||
// Unblocked <id> '<description>'
|
||||
void feedback_unblocked (const Task& task)
|
||||
{
|
||||
if (context.verbose ("affected") ||
|
||||
context.config.getBoolean ("echo.command")) // Deprecated 2.0
|
||||
{
|
||||
// Get a list of tasks that depended on this task.
|
||||
std::vector <Task> blocked;
|
||||
dependencyGetBlocked (task, blocked);
|
||||
|
||||
// Scan all the tasks that were blocked by this task
|
||||
std::vector <Task>::iterator i;
|
||||
for (i = blocked.begin (); i != blocked.end (); ++i)
|
||||
{
|
||||
std::vector <Task> blocking;
|
||||
dependencyGetBlocking (*i, blocking);
|
||||
if (blocking.size () == 0)
|
||||
{
|
||||
if (i->id)
|
||||
std::cout << format (STRING_FEEDBACK_UNBLOCKED,
|
||||
i->id,
|
||||
i->get ("description"))
|
||||
<< "\n";
|
||||
else
|
||||
{
|
||||
std::string uuid = i->get ("uuid");
|
||||
std::cout << format (STRING_FEEDBACK_UNBLOCKED,
|
||||
i->get ("uuid"),
|
||||
i->get ("description"))
|
||||
<< "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue