mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Undo
- 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:
parent
94ce784f33
commit
c1f33a23d3
4 changed files with 346 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue