- Stubbed the undo implementation in TB2::revert (undo as a name is
  already taken), and in the process lose the capability.
- Add detection of <modifications> when running the 'undo' command
  and generate an error.
This commit is contained in:
Paul Beckingham 2011-08-30 00:42:04 -04:00
parent 94ce784f33
commit c1f33a23d3
4 changed files with 346 additions and 4 deletions

View file

@ -46,11 +46,12 @@ CmdUndo::CmdUndo ()
////////////////////////////////////////////////////////////////////////////////
int CmdUndo::execute (std::string& output)
{
// TODO Detect attemps to modify the task.
// Detect attemps to modify the task.
if (context.a3.extract_modifications ().size () > 0)
throw STRING_CMD_UNDO_MODS;
context.tdb.lock (context.config.getBoolean ("locking"));
context.tdb.undo ();
context.tdb.unlock ();
context.tdb2.revert ();
context.tdb2.commit ();
return 0;
}