MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / execute

Method execute

src/commands/CmdUndo.cpp:56–67  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

54
55////////////////////////////////////////////////////////////////////////////////
56int CmdUndo::execute(std::string&) {
57 auto& replica = Context::getContext().tdb2.replica();
58 rust::Vec<tc::Operation> undo_ops = replica->get_undo_operations();
59 if (confirm_revert(Operation::operations(undo_ops))) {
60 // Note that commit_reversed_operations rebuilds the working set, so that
61 // need not be done here.
62 if (!replica->commit_reversed_operations(std::move(undo_ops))) {
63 std::cout << "Could not undo: other operations have occurred.";
64 }
65 }
66 return 0;
67}
68
69////////////////////////////////////////////////////////////////////////////////
70bool CmdUndo::confirm_revert(const std::vector<Operation>& undo_ops) {

Callers

nothing calls this directly

Calls 3

operationsFunction · 0.85
get_undo_operationsMethod · 0.80

Tested by

no test coverage detected