mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CmdUndo
- Converted from A3 to A3t.
This commit is contained in:
parent
f89f5469a4
commit
1f8763829d
1 changed files with 5 additions and 3 deletions
|
@ -44,9 +44,11 @@ CmdUndo::CmdUndo ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdUndo::execute (std::string& output)
|
||||
{
|
||||
// Detect attemps to modify the task.
|
||||
if (context.a3.extract_modifications ().size () > 0)
|
||||
throw std::string (STRING_CMD_UNDO_MODS);
|
||||
// Detect attempts to modify the task.
|
||||
std::vector <Tree*>::iterator i;
|
||||
for (i = context.a3t.tree ()->_branches.begin (); i != context.a3t.tree ()->_branches.end (); ++i)
|
||||
if ((*i)->hasTag ("MODIFICATION"))
|
||||
throw std::string (STRING_CMD_UNDO_MODS);
|
||||
|
||||
context.tdb2.revert ();
|
||||
context.tdb2.commit ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue