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

Method modifyAndUpdate

src/commands/CmdModify.cpp:129–149  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

127
128////////////////////////////////////////////////////////////////////////////////
129int CmdModify::modifyAndUpdate(Task& before, Task& after,
130 std::map<std::string, std::string>* projectChanges /* = NULL */) {
131 // This task.
132 auto count = 1;
133
134 updateRecurrenceMask(after);
135 feedback_affected("Modifying task {1} '{2}'.", after);
136 feedback_unblocked(after);
137 Context::getContext().tdb2.modify(after);
138 if (Context::getContext().verbose("project") && projectChanges)
139 (*projectChanges)[after.get("project")] = onProjectChange(before, after);
140
141 // Task has siblings - modify them.
142 if (after.has("parent")) count += modifyRecurrenceSiblings(after, projectChanges);
143
144 // Task has child tasks - modify them.
145 else if (after.get("status") == "recurring")
146 count += modifyRecurrenceParent(after, projectChanges);
147
148 return count;
149}
150
151////////////////////////////////////////////////////////////////////////////////
152int CmdModify::modifyRecurrenceSiblings(

Callers 1

importSingleTaskMethod · 0.80

Calls 8

updateRecurrenceMaskFunction · 0.85
feedback_affectedFunction · 0.85
feedback_unblockedFunction · 0.85
onProjectChangeFunction · 0.85
verboseMethod · 0.80
modifyMethod · 0.45
getMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected