mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TDB2
- Converted 'annotate' to TDB2.
This commit is contained in:
parent
2708aabddf
commit
402f1f1b41
1 changed files with 3 additions and 11 deletions
|
@ -54,14 +54,9 @@ int CmdAnnotate::execute (std::string& output)
|
||||||
int count = 0;
|
int count = 0;
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
|
|
||||||
std::vector <Task> tasks;
|
|
||||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
|
||||||
context.tdb.loadPending (tasks);
|
|
||||||
|
|
||||||
// Apply filter.
|
// Apply filter.
|
||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
filter (tasks, filtered);
|
filter (filtered);
|
||||||
|
|
||||||
if (filtered.size () == 0)
|
if (filtered.size () == 0)
|
||||||
{
|
{
|
||||||
context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
|
context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
|
||||||
|
@ -93,7 +88,7 @@ int CmdAnnotate::execute (std::string& output)
|
||||||
taskDifferences (before, *task)
|
taskDifferences (before, *task)
|
||||||
+ STRING_CMD_DONE_PROCEED))
|
+ STRING_CMD_DONE_PROCEED))
|
||||||
{
|
{
|
||||||
context.tdb.update (*task);
|
context.tdb2.modify (*task);
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
if (context.config.getBoolean ("echo.command"))
|
if (context.config.getBoolean ("echo.command"))
|
||||||
|
@ -105,10 +100,7 @@ int CmdAnnotate::execute (std::string& output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count)
|
context.tdb2.commit ();
|
||||||
context.tdb.commit ();
|
|
||||||
|
|
||||||
context.tdb.unlock ();
|
|
||||||
|
|
||||||
if (context.config.getBoolean ("echo.command"))
|
if (context.config.getBoolean ("echo.command"))
|
||||||
out << format ((count == 1
|
out << format ((count == 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue