Confirmation

- Modified the 'modify' command so that it only applies changes if
  the requested changes made a difference.  For example if the command

    task 1 mod pri:H

  was followed by:

    task 1 mod pri:H

  then the second command will report 'task not changed'.
This commit is contained in:
Paul Beckingham 2011-10-15 23:07:35 -04:00
parent 3786e6cff3
commit aaa8c5e950

View file

@ -72,7 +72,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 (taskDiff (before, *task))
{
// Perform some logical consistency checks. // Perform some logical consistency checks.
if (task->has ("recur") && if (task->has ("recur") &&
!task->has ("due") && !task->has ("due") &&
@ -138,6 +139,7 @@ int CmdModify::execute (std::string& output)
rc = 1; rc = 1;
} }
} }
}
context.tdb2.commit (); context.tdb2.commit ();
feedback_affected (count == 1 ? STRING_CMD_MODIFY_1 : STRING_CMD_MODIFY_N, count); feedback_affected (count == 1 ? STRING_CMD_MODIFY_1 : STRING_CMD_MODIFY_N, count);