Merge branch '2.3.0' of tasktools.org:task into 2.3.0
This commit is contained in:
@@ -368,6 +368,8 @@ bool Duration::valid (const std::string& input)
|
||||
Nibbler n (lower_input);
|
||||
n.getNumber (value);
|
||||
|
||||
// Negative values are valid, but do not need to complicate the validation
|
||||
// check.
|
||||
if (value < 0.0)
|
||||
value = -value;
|
||||
|
||||
|
||||
@@ -185,7 +185,10 @@ void E9::eval (const Task& task, std::vector <Arg>& value_stack)
|
||||
{
|
||||
Duration dur (operand._raw);
|
||||
Date now;
|
||||
now += (int)(time_t) dur;
|
||||
if (dur.negative ())
|
||||
now -= (int)(time_t) dur;
|
||||
else
|
||||
now += (int)(time_t) dur;
|
||||
operand._value = now.toEpochString ();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -990,11 +990,6 @@ void Task::addDependency (const std::string& uuid)
|
||||
if (uuid == get ("uuid"))
|
||||
throw std::string (STRING_TASK_DEPEND_ITSELF);
|
||||
|
||||
// Check that uuid is resolvable.
|
||||
int id = context.tdb2.pending.id (uuid);
|
||||
if (id == 0)
|
||||
throw format (STRING_TASK_DEPEND_MISS_CREA, id);
|
||||
|
||||
// Store the dependency.
|
||||
std::string depends = get ("depends");
|
||||
if (depends != "")
|
||||
|
||||
@@ -660,20 +660,10 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
|
||||
std::vector <std::string>::iterator dep;
|
||||
for (dep = dependencies.begin (); dep != dependencies.end (); ++dep)
|
||||
{
|
||||
std::vector <int> ids;
|
||||
|
||||
// Crude UUID check
|
||||
if (dep->length () == 36)
|
||||
{
|
||||
int id = context.tdb2.pending.id (*dep);
|
||||
ids.push_back (id);
|
||||
}
|
||||
if (dep->length () >= 7)
|
||||
task.addDependency (*dep);
|
||||
else
|
||||
A3::extract_id (*dep, ids);
|
||||
|
||||
std::vector <int>::iterator id;
|
||||
for (id = ids.begin (); id != ids.end(); id++)
|
||||
task.addDependency (*id);
|
||||
task.addDependency ((int) strtol (dep->c_str (), NULL, 10));
|
||||
}
|
||||
|
||||
// UDAs
|
||||
|
||||
@@ -463,7 +463,7 @@ void Command::modify_task (
|
||||
std::string& description)
|
||||
{
|
||||
// Utilize Task::modify
|
||||
task.modify(arguments, description);
|
||||
task.modify (arguments, description);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user