From 27a56d15db715744415cc8676b5fe1fe700320c1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 12 Jul 2010 20:21:46 -0400 Subject: [PATCH] Dependencies - log - Prevent completed tasks, via the log command, from being marked as dependent. --- src/command.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 552354381..e12c3b727 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -150,6 +150,10 @@ int handleLog (std::string &outs) if (context.task.has ("wait")) 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. if (context.task.get ("project") == "") context.task.set ("project", context.config.get ("default.project")); @@ -166,8 +170,6 @@ int handleLog (std::string &outs) foreach (tag, context.tagAdditions) context.task.addTag (*tag); - // TODO Resolve dependencies. - // Only valid tasks can be added. context.task.validate ();