Feature - merge command

- Merged patch that implements the first milestone of the merge
  feature.  Thanks to Johannes Schlatow.
This commit is contained in:
Paul Beckingham 2010-07-01 20:22:33 -04:00
parent d7c446f010
commit 213a7a519b
12 changed files with 800 additions and 10 deletions

View file

@ -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)
{