diff --git a/AUTHORS b/AUTHORS index 28e41994b..e13a3f483 100644 --- a/AUTHORS +++ b/AUTHORS @@ -282,3 +282,5 @@ suggestions: James Dietrich JDufault Simon Michael + Robin Green + diff --git a/ChangeLog b/ChangeLog index 2348bcb85..9f009a35a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ - TW-1704 Use Task::identifier to reference the Task in the output - TW-1705 Directories in .task/hooks should not be reported as invalid hooks (thanks to Tomas Babej). +- TW-1714 Starting recurring task starts all recurrences (thanks to Robin Green). - TW-1720 CmdContext uses a mix of both throw and std::cout to convey errors (thanks to Paul Beckingham). - TW-1723 task info causes segfault (thanks to Roman Golovin). diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index 5f2926a40..76e8d24cf 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -59,9 +59,14 @@ int CmdAdd::execute (std::string& output) context.tdb2.add (task); // Do not display ID 0, users cannot query by that - if (context.verbose ("new-id") && task.id != 0) + auto status = task.getStatus (); + if (context.verbose ("new-id") && + (status == Task::pending || + status == Task::waiting)) output += format (STRING_CMD_ADD_FEEDBACK, task.id) + "\n"; - else if (context.verbose ("new-uuid")) + + else if (context.verbose ("new-uuid") && + status != Task::recurring) output += format (STRING_CMD_ADD_FEEDBACK, task.get ("uuid")) + "\n"; if (context.verbose ("project")) diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index d4c3275af..9f0cc84f7 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -114,9 +114,14 @@ int CmdDuplicate::execute (std::string&) ++count; feedback_affected (STRING_CMD_DUPLICATE_TASK, task); - if (context.verbose ("new-id")) + auto status = dup.getStatus (); + if (context.verbose ("new-id") && + (status == Task::pending || + status == Task::waiting)) std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.id) + "\n"; - else if (context.verbose ("new-uuid")) + + else if (context.verbose ("new-uuid") && + status != Task::recurring) std::cout << format (STRING_CMD_ADD_FEEDBACK, dup.get ("uuid")) + "\n"; if (context.verbose ("project")) diff --git a/test/confirmation.t b/test/confirmation.t index fb4518e17..7568f2a8c 100755 --- a/test/confirmation.t +++ b/test/confirmation.t @@ -85,7 +85,6 @@ class TestBug1438(TestCase): def test_recurring_tasks_shouldn_ask_for_confirmation(self): """1438: rc.confirmation=off still prompts while changing recurring tasks""" code, out, err = self.t("add Sometimes due:tomorrow recur:daily") - self.assertIn("Created task 1", out) code, out, err = self.t("list") self.assertIn("Sometimes", out) diff --git a/test/recurrence.t b/test/recurrence.t index c2daa5227..7e8fbfc5b 100755 --- a/test/recurrence.t +++ b/test/recurrence.t @@ -498,10 +498,7 @@ class TestBugC001(TestCase): def test_id_increment(self): """C001: Verify that entering two consecutive recurring tasks increments reported ID""" code, out, err = self.t("add one due:tomorrow recur:daily") - self.assertIn("Created task 1.", out) - code, out, err = self.t("add two due:tomorrow recur:daily") - self.assertIn("Created task 2.", out) class TestBug839(TestCase): def setUp(self):