mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug #564
- Fixed bug #564, which allowed the deletion of parent recurring tasks (thanks to Peter De Poorter).
This commit is contained in:
parent
367c32c050
commit
3d7bb9d253
11 changed files with 44 additions and 44 deletions
|
@ -36,14 +36,16 @@
|
|||
+ Fixed bug #538, where some color legend items were not readable.
|
||||
+ Fixed bug #539, where the man page task-color(5) contained a line that
|
||||
began with a ' and was not displayed.
|
||||
+ Fixed bug #540, where user names containing @s could not be parsed
|
||||
+ Fixed bug #540, where user names containing @s could not be parsed.
|
||||
+ Fixed bug #541, which prevented sorting by 'age' column in some situations.
|
||||
+ Fixed bug #542, which sorted the countdown columns incorrectly (thanks to
|
||||
Michelle Crane).
|
||||
+ Fixed bug #555, which caused a segfault when logging a task with a project
|
||||
(thanks to Itay Perl).
|
||||
+ Fixed bug #564, which allowed the deletion of parent recurring tasks (thanks
|
||||
to Peter De Poorter).
|
||||
+ Fixed bug #570, which used unsupported brace expansion with dash (default
|
||||
/bin/sh in Ubuntu)
|
||||
/bin/sh in Ubuntu).
|
||||
+ Fixed bug #579, which displayed incorrect counts when using the 'limit:N'
|
||||
filter (thanks to Thomas Sattler).
|
||||
+ Fixed bug #580, where reusing the merge uri for autopush failed when the
|
||||
|
|
|
@ -309,7 +309,10 @@ int TDB::loadPending (std::vector <Task>& tasks, Filter& filter)
|
|||
{
|
||||
// TODO Add hidden attribute indicating source?
|
||||
Task task (line);
|
||||
task.id = mId++;
|
||||
|
||||
Task::status status = task.getStatus ();
|
||||
if (status != Task::recurring)
|
||||
task.id = mId++;
|
||||
|
||||
mPending.push_back (task);
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@ bool Task::operator== (const Task& other)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
Task::Task (const std::string& input)
|
||||
{
|
||||
id = 0;
|
||||
parse (input);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 14;
|
||||
use Test::More tests => 12;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'add.rc')
|
||||
|
@ -55,12 +55,6 @@ like ($output, qr/ID\s+1\n/, 'add ID');
|
|||
like ($output, qr/Status\s+Pending\n/, 'add Pending');
|
||||
like ($output, qr/Description\s+This a TEST\n/, 'add ID');
|
||||
|
||||
# Test delete.
|
||||
qx{../task rc:add.rc delete 1};
|
||||
$output = qx{../task rc:add.rc info 1};
|
||||
like ($output, qr/ID\s+1\n/, 'add ID');
|
||||
like ($output, qr/Status\s+Deleted\n/, 'add Deleted');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
ok (!-r 'pending.data', 'Removed pending.data');
|
||||
|
|
|
@ -45,16 +45,16 @@ qx{../task rc:bug.rc ls};
|
|||
|
||||
# Result: trying to add the project generates an error about removing
|
||||
# recurrence from a task.
|
||||
my $output = qx{../task rc:bug.rc 2 project:bar};
|
||||
my $output = qx{../task rc:bug.rc 1 project:bar};
|
||||
unlike ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'No recurrence removal error');
|
||||
|
||||
# Now try to generate the error above via regular means - ie, is it actually
|
||||
# doing what it should?
|
||||
$output = qx{../task rc:bug.rc 2 recur:};
|
||||
$output = qx{../task rc:bug.rc 1 recur:};
|
||||
like ($output, qr/You cannot remove the recurrence from a recurring task./ms, 'Recurrence removal error');
|
||||
|
||||
# Prevent removal of the due date from a recurring task.
|
||||
$output = qx{../task rc:bug.rc 2 due:};
|
||||
$output = qx{../task rc:bug.rc 1 due:};
|
||||
like ($output, qr/You cannot remove the due date from a recurring task./ms, 'Cannot remove due date from a recurring task');
|
||||
|
||||
# Allow removal of the due date from a non-recurring task.
|
||||
|
|
|
@ -43,30 +43,30 @@ if (open my $fh, '>', 'annual.rc')
|
|||
#
|
||||
# ID Project Pri Due Active Age Description
|
||||
# -- ------- --- ---------- ------ --- -----------
|
||||
# 2 1/1/2000 - foo
|
||||
# 3 12/31/2000 - foo
|
||||
# 4 12/31/2001 - foo
|
||||
# 5 12/31/2002 - foo
|
||||
# 6 12/31/2003 - foo
|
||||
# 7 12/30/2004 - foo
|
||||
# 8 12/30/2005 - foo
|
||||
# 9 12/30/2006 - foo
|
||||
# 10 12/30/2007 - foo
|
||||
# 11 12/29/2008 - foo
|
||||
# 12 12/29/2009 - foo
|
||||
# 1 1/1/2000 - foo
|
||||
# 2 12/31/2000 - foo
|
||||
# 3 12/31/2001 - foo
|
||||
# 4 12/31/2002 - foo
|
||||
# 5 12/31/2003 - foo
|
||||
# 6 12/30/2004 - foo
|
||||
# 7 12/30/2005 - foo
|
||||
# 8 12/30/2006 - foo
|
||||
# 9 12/30/2007 - foo
|
||||
# 10 12/29/2008 - foo
|
||||
# 11 12/29/2009 - foo
|
||||
|
||||
qx{../task rc:annual.rc add foo due:1/1/2000 recur:annual until:1/1/2009};
|
||||
my $output = qx{../task rc:annual.rc list};
|
||||
like ($output, qr/2\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 1 no creep');
|
||||
like ($output, qr/3\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep');
|
||||
like ($output, qr/4\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep');
|
||||
like ($output, qr/5\s+1\/1\/2003\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 4 no creep');
|
||||
like ($output, qr/6\s+1\/1\/2004\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 5 no creep');
|
||||
like ($output, qr/7\s+1\/1\/2005\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 6 no creep');
|
||||
like ($output, qr/8\s+1\/1\/2006\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 7 no creep');
|
||||
like ($output, qr/9\s+1\/1\/2007\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 8 no creep');
|
||||
like ($output, qr/10\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 9 no creep');
|
||||
like ($output, qr/11\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no creep');
|
||||
like ($output, qr/1\s+1\/1\/2000\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 1 no creep');
|
||||
like ($output, qr/2\s+1\/1\/2001\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 2 no creep');
|
||||
like ($output, qr/3\s+1\/1\/2002\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 3 no creep');
|
||||
like ($output, qr/4\s+1\/1\/2003\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 4 no creep');
|
||||
like ($output, qr/5\s+1\/1\/2004\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 5 no creep');
|
||||
like ($output, qr/6\s+1\/1\/2005\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 6 no creep');
|
||||
like ($output, qr/7\s+1\/1\/2006\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 7 no creep');
|
||||
like ($output, qr/8\s+1\/1\/2007\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 8 no creep');
|
||||
like ($output, qr/9\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 9 no creep');
|
||||
like ($output, qr/10\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no creep');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
|
|
@ -47,7 +47,7 @@ if (open my $fh, '>', 'response.txt')
|
|||
ok (-r 'response.txt', 'Created response.txt');
|
||||
}
|
||||
|
||||
qx{../task rc:confirm.rc add foo} for 1 .. 10;
|
||||
qx{../task rc:confirm.rc add foo} for 1..10;
|
||||
|
||||
# Test the various forms of "Yes".
|
||||
my $output = qx{echo "Yes" | ../task rc:confirm.rc del 1};
|
||||
|
|
|
@ -47,12 +47,12 @@ qx{../task rc:custom.rc add foo due:tomorrow recur:weekly};
|
|||
qx{../task rc:custom.rc add bar};
|
||||
my $output = qx{../task rc:custom.rc foo 2>&1};
|
||||
like ($output, qr/ID R/, 'Recurrence indicator heading');
|
||||
like ($output, qr/3\s+R/, 'Recurrence indicator t1');
|
||||
unlike ($output, qr/2\s+R/, 'No recurrence indicator t2');
|
||||
like ($output, qr/2\s+R/, 'Recurrence indicator t1');
|
||||
unlike ($output, qr/1\s+R/, 'No recurrence indicator t2');
|
||||
|
||||
$output = qx{../task rc:custom.rc foo rc.recurrence.indicator=RE 2>&1};
|
||||
like ($output, qr/3\s+RE/, 'Custom recurrence indicator t1');
|
||||
unlike ($output, qr/2\s+RE/, 'No custom recurrence indicator t2');
|
||||
like ($output, qr/2\s+RE/, 'Custom recurrence indicator t1');
|
||||
unlike ($output, qr/1\s+RE/, 'No custom recurrence indicator t2');
|
||||
|
||||
# Cleanup.
|
||||
unlink 'pending.data';
|
||||
|
|
|
@ -121,11 +121,12 @@ qx{../task rc:dep.rc add Five};
|
|||
qx{../task rc:dep.rc add Six recurring due:tomorrow recur:daily};
|
||||
|
||||
# [20]
|
||||
qx{../task rc:dep.rc ls}; # To force handleRecurrence call.
|
||||
$output = qx{../task rc:dep.rc 6 dep:5};
|
||||
like ($output, qr/Modified \d+ task/, 'dependencies - recurring task depending on another task');
|
||||
|
||||
# [21]
|
||||
$output = qx{../task rc:dep.rc 5 dep:6};
|
||||
$output = qx{../task rc:dep.rc 4 dep:5};
|
||||
like ($output, qr/Modified \d+ task/, 'dependencies - task depending on recurring task');
|
||||
|
||||
# [22] t 1 dep:2,3,4; t 1 dep:-2,-4,5; t info 1 => blocked by 3,5
|
||||
|
|
|
@ -43,12 +43,12 @@ qx{../task rc:recur.rc add foo due:now recur:2sec until:5sec};
|
|||
diag ("Sleeping for 6 seconds");
|
||||
sleep 6;
|
||||
my $output = qx{../task rc:recur.rc list};
|
||||
like ($output, qr/^\s+1/ms, 'Found 1');
|
||||
like ($output, qr/^\s+2/ms, 'Found 2');
|
||||
like ($output, qr/^\s+3/ms, 'Found 3');
|
||||
like ($output, qr/^\s+4/ms, 'Found 4');
|
||||
like ($output, qr/^\s+5/ms, 'Found 5');
|
||||
|
||||
qx{../task rc:recur.rc do $_} for 2..6;
|
||||
qx{../task rc:recur.rc do $_} for 1..5;
|
||||
$output = qx{../task rc:recur.rc list};
|
||||
like ($output, qr/and has been deleted/, 'Parent task deleted');
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 8;
|
||||
use Test::More tests => 7;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'recur.rc')
|
||||
|
@ -44,7 +44,6 @@ my $output = qx{../task rc:recur.rc list};
|
|||
like ($output, qr/one/, 'recur weekdays');
|
||||
|
||||
$output = qx{../task rc:recur.rc info 1};
|
||||
like ($output, qr/Status\s+Recurring/, 'task is recurring');
|
||||
like ($output, qr/Recurrence\s+weekdays/, 'task recurs every weekday');
|
||||
|
||||
qx{../task rc:recur.rc do 1};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue