Dependencies - #410
- Completed support for 'task 1 depends:2,-3' to manipulate the dependencies. - Now supports rc.dependency.reminder to indicate when to nag about dependency chain violations, defaulting to on. - Now supports rc.dependency.confirm to require confirmation before fixing dependency chains, defaulting to on. - New source file dependency.cpp which implements a low-level API for determining dependency status, and assorted handlers for task state changes. - Adds blocking tasks to the 'next' report. - Added more dependency unit tests, changed the wording in a couple of them and numbered them for easy reference.
This commit is contained in:
@@ -444,7 +444,7 @@ int handleInfo (std::string &outs)
|
||||
// dependencies: blocked
|
||||
{
|
||||
std::vector <Task> blocked;
|
||||
dependencyGetBlocked (*task, blocked);
|
||||
dependencyGetBlocking (*task, blocked);
|
||||
if (blocked.size ())
|
||||
{
|
||||
std::stringstream message;
|
||||
@@ -461,7 +461,7 @@ int handleInfo (std::string &outs)
|
||||
// dependencies: blocking
|
||||
{
|
||||
std::vector <Task> blocking;
|
||||
dependencyGetBlocking (*task, blocking);
|
||||
dependencyGetBlocked (*task, blocking);
|
||||
if (blocking.size ())
|
||||
{
|
||||
std::stringstream message;
|
||||
@@ -2633,6 +2633,22 @@ void gatherNextTasks (std::vector <Task>& tasks)
|
||||
}
|
||||
}
|
||||
|
||||
// blocking, not blocked
|
||||
foreach (task, tasks)
|
||||
{
|
||||
if (dependencyIsBlocking (*task) &&
|
||||
! dependencyIsBlocked (*task))
|
||||
{
|
||||
std::string project = task->get ("project");
|
||||
if (countByProject[project] < limit && matching.find (task->id) == matching.end ())
|
||||
{
|
||||
++countByProject[project];
|
||||
matching[task->id] = true;
|
||||
filtered.push_back (*task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// due:*, pri:H
|
||||
foreach (task, tasks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user