mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Dependencies - info
- Added blocked and blocking tasks to the info report.
This commit is contained in:
parent
19b803312f
commit
54cf7e5471
2 changed files with 36 additions and 1 deletions
|
@ -603,7 +603,7 @@ int handleCustomReport (const std::string& report, std::string &outs)
|
||||||
foreach (task, tasks)
|
foreach (task, tasks)
|
||||||
{
|
{
|
||||||
task->getDependencies (all);
|
task->getDependencies (all);
|
||||||
join (deps, " ", all);
|
join (deps, ", ", all);
|
||||||
context.hooks.trigger ("format-depends", "depends", deps);
|
context.hooks.trigger ("format-depends", "depends", deps);
|
||||||
table.addCell (row++, columnCount, deps);
|
table.addCell (row++, columnCount, deps);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <algorithm>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -420,6 +421,40 @@ int handleInfo (std::string &outs)
|
||||||
table.addCell (row, 1, value);
|
table.addCell (row, 1, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dependencies: blocked
|
||||||
|
row = table.addRow ();
|
||||||
|
table.addCell (row, 0, "This task blocked by");
|
||||||
|
if (task->has ("depends"))
|
||||||
|
{
|
||||||
|
std::string depends = task->get ("depends");
|
||||||
|
const std::vector <Task>& rpending = context.tdb.getAllPending ();
|
||||||
|
|
||||||
|
std::stringstream blocked;
|
||||||
|
std::vector <Task>::const_iterator it;
|
||||||
|
for (it = rpending.begin (); it != rpending.end (); ++it)
|
||||||
|
if (depends.find (it->get ("uuid")) != std::string::npos)
|
||||||
|
blocked << it->id << " " << it->get ("description") << "\n";
|
||||||
|
|
||||||
|
table.addCell (row, 1, blocked.str ());
|
||||||
|
}
|
||||||
|
|
||||||
|
// dependencies: blocking
|
||||||
|
{
|
||||||
|
row = table.addRow ();
|
||||||
|
table.addCell (row, 0, "This task is blocking");
|
||||||
|
|
||||||
|
std::string uuid = task->get ("uuid");
|
||||||
|
const std::vector <Task>& rpending = context.tdb.getAllPending ();
|
||||||
|
|
||||||
|
std::stringstream blocked;
|
||||||
|
std::vector <Task>::const_iterator it;
|
||||||
|
for (it = rpending.begin (); it != rpending.end (); ++it)
|
||||||
|
if (it->get ("depends").find (uuid) != std::string::npos)
|
||||||
|
blocked << it->id << " " << it->get ("description") << "\n";
|
||||||
|
|
||||||
|
table.addCell (row, 1, blocked.str ());
|
||||||
|
}
|
||||||
|
|
||||||
if (task->getStatus () == Task::recurring ||
|
if (task->getStatus () == Task::recurring ||
|
||||||
task->has ("parent"))
|
task->has ("parent"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue