mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
CmdModify
- Converted from A3 modifications to Task::modify.
This commit is contained in:
parent
6f32fa9b54
commit
5a0c07782e
1 changed files with 5 additions and 7 deletions
|
@ -62,10 +62,7 @@ int CmdModify::execute (std::string& output)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the command line modifications to the new task.
|
// TODO Complain when no modifications are specified.
|
||||||
A3 modifications = context.a3.extract_modifications ();
|
|
||||||
if (!modifications.size ())
|
|
||||||
throw std::string (STRING_CMD_MODIFY_NEED_TEXT);
|
|
||||||
|
|
||||||
// Accumulated project change notifications.
|
// Accumulated project change notifications.
|
||||||
std::map <std::string, std::string> projectChanges;
|
std::map <std::string, std::string> projectChanges;
|
||||||
|
@ -74,7 +71,8 @@ int CmdModify::execute (std::string& output)
|
||||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||||
{
|
{
|
||||||
Task before (*task);
|
Task before (*task);
|
||||||
modify_task_description_replace (*task, modifications);
|
task->modify (Task::modReplace);
|
||||||
|
|
||||||
if (taskDiff (before, *task))
|
if (taskDiff (before, *task))
|
||||||
{
|
{
|
||||||
// Perform some logical consistency checks.
|
// Perform some logical consistency checks.
|
||||||
|
@ -127,7 +125,7 @@ int CmdModify::execute (std::string& output)
|
||||||
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling)
|
||||||
{
|
{
|
||||||
Task alternate (*sibling);
|
Task alternate (*sibling);
|
||||||
modify_task_description_replace (*sibling, modifications);
|
sibling->modify (Task::modReplace);
|
||||||
updateRecurrenceMask (*sibling);
|
updateRecurrenceMask (*sibling);
|
||||||
dependencyChainOnModify (alternate, *sibling);
|
dependencyChainOnModify (alternate, *sibling);
|
||||||
++count;
|
++count;
|
||||||
|
@ -151,7 +149,7 @@ int CmdModify::execute (std::string& output)
|
||||||
for (child = children.begin (); child != children.end (); ++child)
|
for (child = children.begin (); child != children.end (); ++child)
|
||||||
{
|
{
|
||||||
Task alternate (*child);
|
Task alternate (*child);
|
||||||
modify_task_description_replace (*child, modifications);
|
child->modify (Task::modReplace);
|
||||||
updateRecurrenceMask (*child);
|
updateRecurrenceMask (*child);
|
||||||
context.tdb2.modify (*child);
|
context.tdb2.modify (*child);
|
||||||
dependencyChainOnModify (alternate, *child);
|
dependencyChainOnModify (alternate, *child);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue