mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2
- Converted 'denotate' command to TDB2.
This commit is contained in:
parent
ba5daece99
commit
965dabadf9
1 changed files with 3 additions and 12 deletions
|
@ -54,14 +54,9 @@ int CmdDenotate::execute (std::string& output)
|
|||
int count = 0;
|
||||
std::stringstream out;
|
||||
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
context.tdb.loadPending (tasks);
|
||||
|
||||
// Apply filter.
|
||||
std::vector <Task> filtered;
|
||||
filter (tasks, filtered);
|
||||
|
||||
filter (filtered);
|
||||
if (filtered.size () == 0)
|
||||
{
|
||||
context.footnote (STRING_FEEDBACK_NO_TASKS_SP);
|
||||
|
@ -128,7 +123,7 @@ int CmdDenotate::execute (std::string& output)
|
|||
taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
||||
{
|
||||
++count;
|
||||
context.tdb.update (*task);
|
||||
context.tdb2.modify (*task);
|
||||
if (context.config.getBoolean ("echo.command"))
|
||||
out << format (STRING_CMD_DENO_FOUND, anno)
|
||||
<< "\n";
|
||||
|
@ -139,11 +134,7 @@ int CmdDenotate::execute (std::string& output)
|
|||
<< "\n";
|
||||
}
|
||||
|
||||
if (count)
|
||||
context.tdb.commit ();
|
||||
|
||||
context.tdb.unlock ();
|
||||
|
||||
context.tdb2.commit ();
|
||||
output = out.str ();
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue