mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Bug
- The modify command no longer claims that a task was modified if no changes were applied.
This commit is contained in:
parent
19f598419e
commit
9ada2f554a
3 changed files with 26 additions and 25 deletions
43
src/TDB2.cpp
43
src/TDB2.cpp
|
@ -551,29 +551,32 @@ void TDB2::modify (Task& task)
|
|||
Task original;
|
||||
get (task.get ("uuid"), original);
|
||||
|
||||
std::string status = original.get ("status");
|
||||
if (status == "pending" ||
|
||||
status == "waiting" ||
|
||||
status == "recurring")
|
||||
if (taskDiff (original, task))
|
||||
{
|
||||
pending.modify_task (task);
|
||||
}
|
||||
else
|
||||
{
|
||||
completed.modify_task (task);
|
||||
}
|
||||
std::string status = original.get ("status");
|
||||
if (status == "pending" ||
|
||||
status == "waiting" ||
|
||||
status == "recurring")
|
||||
{
|
||||
pending.modify_task (task);
|
||||
}
|
||||
else
|
||||
{
|
||||
completed.modify_task (task);
|
||||
}
|
||||
|
||||
// time <time>
|
||||
// old <task>
|
||||
// new <task>
|
||||
// ---
|
||||
undo.add_line ("time " + Date ().toEpochString () + "\n");
|
||||
undo.add_line ("old " + original.composeF4 ());
|
||||
undo.add_line ("new " + task.composeF4 ());
|
||||
undo.add_line ("---\n");
|
||||
// time <time>
|
||||
// old <task>
|
||||
// new <task>
|
||||
// ---
|
||||
undo.add_line ("time " + Date ().toEpochString () + "\n");
|
||||
undo.add_line ("old " + original.composeF4 ());
|
||||
undo.add_line ("new " + task.composeF4 ());
|
||||
undo.add_line ("---\n");
|
||||
|
||||
// Add modified task to backlog.
|
||||
backlog.add_task (task);
|
||||
// Add modified task to backlog.
|
||||
backlog.add_task (task);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -749,9 +749,8 @@ void Task::removeDependency (const std::string& uuid)
|
|||
std::string combined;
|
||||
join (combined, ",", deps);
|
||||
set ("depends", combined);
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -762,8 +761,6 @@ void Task::removeDependency (int id)
|
|||
removeDependency (uuid);
|
||||
else
|
||||
throw std::string (STRING_TASK_DEPEND_NO_UUID);
|
||||
|
||||
recalc_urgency = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -78,7 +78,8 @@ int CmdModify::execute (std::string& output)
|
|||
Task before (*task);
|
||||
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;
|
||||
context.tdb2.modify (*task);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue