mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-01 18:27:20 +02:00
Logic Bug
- Fixed bug in bulk operation handling for recurring tasks.
This commit is contained in:
parent
887439b914
commit
9a7d631873
1 changed files with 36 additions and 17 deletions
|
@ -25,7 +25,6 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#define L10N // Localization complete.
|
#define L10N // Localization complete.
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -64,7 +63,7 @@ int CmdStop::execute (std::string& output)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the command line modifications to the stopped task.
|
// Apply the command line modifications to the new task.
|
||||||
A3 modifications = context.a3.extract_modifications ();
|
A3 modifications = context.a3.extract_modifications ();
|
||||||
|
|
||||||
Permission permission;
|
Permission permission;
|
||||||
|
@ -78,33 +77,44 @@ int CmdStop::execute (std::string& output)
|
||||||
{
|
{
|
||||||
Task before (*task);
|
Task before (*task);
|
||||||
|
|
||||||
modify_task_annotate (*task, modifications);
|
// Complete the specified task.
|
||||||
|
std::string question = format (STRING_CMD_STOP_QUESTION,
|
||||||
|
task->id,
|
||||||
|
task->get ("description"));
|
||||||
|
|
||||||
// Remove the start time.
|
modify_task_annotate (*task, modifications);
|
||||||
task->remove ("start");
|
task->remove ("start");
|
||||||
|
|
||||||
if (context.config.getBoolean ("journal.time"))
|
if (context.config.getBoolean ("journal.time"))
|
||||||
task->addAnnotation (context.config.get ("journal.time.stop.annotation"));
|
task->addAnnotation (context.config.get ("journal.time.stop.annotation"));
|
||||||
|
|
||||||
if (taskDiff (before, *task))
|
if (permission.confirmed (*task, taskDifferences (before, *task) + question))
|
||||||
{
|
{
|
||||||
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
updateRecurrenceMask (*task);
|
||||||
{
|
context.tdb2.modify (*task);
|
||||||
context.tdb2.modify (*task);
|
++count;
|
||||||
++count;
|
|
||||||
|
|
||||||
if (context.verbose ("affected") ||
|
if (context.verbose ("affected") ||
|
||||||
context.config.getBoolean ("echo.command")) // Deprecated 2.0
|
context.config.getBoolean ("echo.command")) // Deprecated 2.0
|
||||||
out << format (STRING_CMD_STOP_DONE,
|
out << format (task->has ("parent")
|
||||||
task->id,
|
? STRING_CMD_STOP_RECURRING
|
||||||
task->get ("description"))
|
: STRING_CMD_STOP_TASK,
|
||||||
<< "\n";
|
task->id,
|
||||||
}
|
task->get ("description"))
|
||||||
|
<< "\n";
|
||||||
|
|
||||||
|
dependencyChainOnStart (*task);
|
||||||
|
context.footnote (onProjectChange (*task, false));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out << format (STRING_CMD_STOP_NOT, task->id) << "\n";
|
||||||
|
rc = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
out << format (STRING_CMD_STOP_NOT,
|
out << format (STRING_CMD_STOP_ALREADY,
|
||||||
task->id,
|
task->id,
|
||||||
task->get ("description"))
|
task->get ("description"))
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
@ -113,6 +123,15 @@ int CmdStop::execute (std::string& output)
|
||||||
}
|
}
|
||||||
|
|
||||||
context.tdb2.commit ();
|
context.tdb2.commit ();
|
||||||
|
|
||||||
|
if (context.verbose ("affected") ||
|
||||||
|
context.config.getBoolean ("echo.command")) // Deprecated 2.0
|
||||||
|
out << format ((count == 1
|
||||||
|
? STRING_CMD_STOP_STOPPED
|
||||||
|
: STRING_CMD_STOP_STOPPED_N),
|
||||||
|
count)
|
||||||
|
<< "\n";
|
||||||
|
|
||||||
output = out.str ();
|
output = out.str ();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue