Dependencies - log

- Prevent completed tasks, via the log command, from being marked
  as dependent.
This commit is contained in:
Paul Beckingham 2010-07-12 20:21:46 -04:00
parent 98cef98111
commit 27a56d15db

View file

@ -150,6 +150,10 @@ int handleLog (std::string &outs)
if (context.task.has ("wait")) if (context.task.has ("wait"))
throw std::string ("You cannot log waiting tasks."); throw std::string ("You cannot log waiting tasks.");
// It makes no sense to add dependencies to an already-completed task.
if (context.task.get ("depends") != "")
throw std::string ("You cannot specify dependencies on a completed task.");
// Override with default.project, if not specified. // Override with default.project, if not specified.
if (context.task.get ("project") == "") if (context.task.get ("project") == "")
context.task.set ("project", context.config.get ("default.project")); context.task.set ("project", context.config.get ("default.project"));
@ -166,8 +170,6 @@ int handleLog (std::string &outs)
foreach (tag, context.tagAdditions) foreach (tag, context.tagAdditions)
context.task.addTag (*tag); context.task.addTag (*tag);
// TODO Resolve dependencies.
// Only valid tasks can be added. // Only valid tasks can be added.
context.task.validate (); context.task.validate ();