mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature - merge command
- Merged patch that implements the first milestone of the merge feature. Thanks to Johannes Schlatow.
This commit is contained in:
parent
d7c446f010
commit
213a7a519b
12 changed files with 800 additions and 10 deletions
|
@ -516,6 +516,25 @@ void handleUndo ()
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleMerge (std::string& outs)
|
||||
{
|
||||
if (context.hooks.trigger ("pre-merge-command"))
|
||||
{
|
||||
std::string file = trim (context.task.get ("description"));
|
||||
if (file.length () > 0)
|
||||
{
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
context.tdb.merge (file);
|
||||
context.tdb.unlock ();
|
||||
|
||||
context.hooks.trigger ("post-merge-command");
|
||||
}
|
||||
else
|
||||
throw std::string ("You must specify a file to merge.");
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int handleVersion (std::string &outs)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue