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;
|
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);
|
||||||
|
@ -128,7 +123,7 @@ int CmdDenotate::execute (std::string& output)
|
||||||
taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
||||||
{
|
{
|
||||||
++count;
|
++count;
|
||||||
context.tdb.update (*task);
|
context.tdb2.modify (*task);
|
||||||
if (context.config.getBoolean ("echo.command"))
|
if (context.config.getBoolean ("echo.command"))
|
||||||
out << format (STRING_CMD_DENO_FOUND, anno)
|
out << format (STRING_CMD_DENO_FOUND, anno)
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
@ -139,11 +134,7 @@ int CmdDenotate::execute (std::string& output)
|
||||||
<< "\n";
|
<< "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count)
|
context.tdb2.commit ();
|
||||||
context.tdb.commit ();
|
|
||||||
|
|
||||||
context.tdb.unlock ();
|
|
||||||
|
|
||||||
output = out.str ();
|
output = out.str ();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue