- The modify command no longer claims that a task was modified if no
  changes were applied.
This commit is contained in:
Paul Beckingham
2011-09-11 13:49:07 -04:00
parent 19f598419e
commit 9ada2f554a
3 changed files with 26 additions and 25 deletions

View File

@@ -551,6 +551,8 @@ void TDB2::modify (Task& task)
Task original; Task original;
get (task.get ("uuid"), original); get (task.get ("uuid"), original);
if (taskDiff (original, task))
{
std::string status = original.get ("status"); std::string status = original.get ("status");
if (status == "pending" || if (status == "pending" ||
status == "waiting" || status == "waiting" ||
@@ -574,6 +576,7 @@ void TDB2::modify (Task& task)
// Add modified task to backlog. // Add modified task to backlog.
backlog.add_task (task); backlog.add_task (task);
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -749,9 +749,8 @@ void Task::removeDependency (const std::string& uuid)
std::string combined; std::string combined;
join (combined, ",", deps); join (combined, ",", deps);
set ("depends", combined); set ("depends", combined);
}
recalc_urgency = true; recalc_urgency = true;
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -762,8 +761,6 @@ void Task::removeDependency (int id)
removeDependency (uuid); removeDependency (uuid);
else else
throw std::string (STRING_TASK_DEPEND_NO_UUID); throw std::string (STRING_TASK_DEPEND_NO_UUID);
recalc_urgency = true;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -78,7 +78,8 @@ int CmdModify::execute (std::string& output)
Task before (*task); Task before (*task);
modify_task_description_replace (*task, modifications); modify_task_description_replace (*task, modifications);
if (permission.confirmed (*task, taskDifferences (before, *task) + "Proceed with change?")) if (taskDiff (before, *task) &&
permission.confirmed (*task, taskDifferences (before, *task) + "Proceed with change?"))
{ {
++count; ++count;
context.tdb2.modify (*task); context.tdb2.modify (*task);