mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TDB2
- Implemented CmdAdd.cpp and CmdLog.cpp using TDB2. - Implemented simple append writes in TDB2. - Modified CmdImport to accept and parse JSON. - Added more const-ness in DOM, Expression and Task, to allow TDB2::get_tasks to return a const vector ref, which is a Very Good Thing. - Corrected usage for the export command. - Implemented Task::urgency as a call to Task::urgency_c, which is a const overload to allow urgency calculations (without caching) for const Task objects. - Removed obolete code from TDB. - Added lots of diagnostic output for TDB2 - it's annoying, but will be gone soon. - Added mention in CmdHelp of the new <filter> and <modifications> syntax elements. Needs more. - Added Command::filter overload which uses TDB2. Not in use yet.
This commit is contained in:
parent
523c4dfcca
commit
8827f9c978
18 changed files with 400 additions and 173 deletions
|
@ -51,12 +51,6 @@ int CmdLog::execute (std::string& output)
|
|||
{
|
||||
int rc = 0;
|
||||
|
||||
// Must load pending to resolve dependencies, and to provide a new ID.
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
|
||||
std::vector <Task> all;
|
||||
context.tdb.loadPending (all);
|
||||
|
||||
// Every task needs a UUID.
|
||||
Task task;
|
||||
task.set ("uuid", uuid ());
|
||||
|
@ -82,13 +76,10 @@ int CmdLog::execute (std::string& output)
|
|||
|
||||
// Only valid tasks can be added.
|
||||
task.validate ();
|
||||
|
||||
context.tdb.add (task);
|
||||
context.tdb2.add (task);
|
||||
|
||||
context.footnote (onProjectChange (task));
|
||||
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
context.tdb2.commit ();
|
||||
|
||||
if (context.config.getBoolean ("echo.command"))
|
||||
output = std::string (STRING_CMD_LOG_LOGGED) + "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue