From 331b08055a894c19047b86019aa9ce45ad96b34e Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Wed, 18 Nov 2009 10:22:33 +0100 Subject: [PATCH 01/23] Bumped version number to 1.8.5 --- ChangeLog | 6 ++++-- configure.ac | 2 +- doc/man/task-tutorial.5 | 2 +- doc/man/task.1 | 2 +- doc/man/taskrc.5 | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0c8e4329..01f712499 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ ------ current release --------------------------- +1.8.4 () + +------ old releases ------------------------------ + 1.8.4 (11/17/2009) 12c4983936d27317df100f05da8244139dd06a3f + Fixed bug that caused wait: dates to not be properly rendered in a readable and preferred format with the "edit" command. @@ -12,8 +16,6 @@ instances of that task may be modified. When task confirms a bulk edit the recurrence is again indicated (thanks to Cory Donnelly). ------- old releases ------------------------------ - 1.8.3 (10/21/2009) bcdcbeeea0d92f21c3565aebfaf6332b959f4025 + Added support for Haiku R1/alpha1 diff --git a/configure.ac b/configure.ac index 5ea8aff72..b870f7472 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(task, 1.8.4, support@taskwarrior.org) +AC_INIT(task, 1.8.5, support@taskwarrior.org) CFLAGS="${CFLAGS=}" CXXFLAGS="${CXXFLAGS=}" diff --git a/doc/man/task-tutorial.5 b/doc/man/task-tutorial.5 index d71286f6e..f1784093a 100644 --- a/doc/man/task-tutorial.5 +++ b/doc/man/task-tutorial.5 @@ -1,4 +1,4 @@ -.TH task-tutorial 5 2009-10-21 "task 1.8.4" "User Manuals" +.TH task-tutorial 5 2009-11-18 "task 1.8.5" "User Manuals" .SH NAME task-tutorial \- A tutorial for the task(1) command line todo manager. diff --git a/doc/man/task.1 b/doc/man/task.1 index 3abb92065..a1259d48e 100644 --- a/doc/man/task.1 +++ b/doc/man/task.1 @@ -1,4 +1,4 @@ -.TH task 1 2009-10-21 "task 1.8.4" "User Manuals" +.TH task 1 2009-11-18 "task 1.8.5" "User Manuals" .SH NAME task \- A command line todo manager. diff --git a/doc/man/taskrc.5 b/doc/man/taskrc.5 index 973d2ba0d..951b7e0b0 100644 --- a/doc/man/taskrc.5 +++ b/doc/man/taskrc.5 @@ -1,4 +1,4 @@ -.TH taskrc 5 2009-10-21 "task 1.8.4" "User Manuals" +.TH taskrc 5 2009-11-18 "task 1.8.5" "User Manuals" .SH NAME taskrc \- Configuration file for the task(1) command From b2fc4969b9e7f403fde4c506c9afa45ae48e7b3b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 18 Nov 2009 20:27:54 -0500 Subject: [PATCH 02/23] Documentation Update - Minor doc edits. --- ChangeLog | 2 +- README | 4 ++-- configure.ac | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01f712499..6ee6a1aaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ ------ current release --------------------------- -1.8.4 () +1.8.5 () ------ old releases ------------------------------ diff --git a/README b/README index de698bba5..08cd2dec8 100644 --- a/README +++ b/README @@ -12,8 +12,8 @@ At the site you'll find a wiki, discussion forums, downloads, news and more. Your contributions are especially welcome. Whether it comes in the form of -code patches, ideas, discussion, bug reports or just encouragement, your input -is needed. +code patches, ideas, discussion, bug reports, encouragement or criticism, your +input is needed. Please send your support questions and code patches to: diff --git a/configure.ac b/configure.ac index b870f7472..ad53579b3 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,7 @@ AC_INIT(task, 1.8.5, support@taskwarrior.org) CFLAGS="${CFLAGS=}" CXXFLAGS="${CXXFLAGS=}" + # this macro is used to get the arguments supplied # to the configure script (./configure --enable-debug) # Check if we have enable debug support. From 549e700bc86df8a84c70e103c131abd7e9e30448 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 18 Nov 2009 20:28:25 -0500 Subject: [PATCH 03/23] Bug Fix - timesheet - The timesheet report was being sorted as though the 'end' date was not being considered a date, but simply a string. --- ChangeLog | 1 + src/custom.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6ee6a1aaf..308690ed6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ ------ current release --------------------------- 1.8.5 () + + Fixed bug that was causing the 'completed' report to sort incorrectly. ------ old releases ------------------------------ diff --git a/src/custom.cpp b/src/custom.cpp index 8426b2279..7c9e73d61 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -474,7 +474,7 @@ int runCustomReport ( Table::descendingPriority)); else if (column == "entry" || column == "start" || column == "due" || - column == "wait") + column == "wait" || column == "until" || column == "end") table.sortOn (columnIndex[column], (direction == '+' ? Table::ascendingDate : From d44e9363f050c54d19822fe343fa2a3d7e079f9d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 21 Nov 2009 17:39:50 -0500 Subject: [PATCH 04/23] Enhancement - better confirmation - Added feature to allow the user to quit when asked to confirm multiple changes. Now task asks "Proceed with change? (Yes/no/all/quit)". --- ChangeLog | 2 ++ src/Permission.cpp | 10 ++++++-- src/Permission.h | 1 + src/command.cpp | 8 +++---- src/tests/confirmation.t | 8 +++---- src/tests/util.t.cpp | 15 ++++++------ src/util.cpp | 50 +++++++++++++++++++++++++++++++++++----- src/util.h | 1 + 8 files changed, 72 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 308690ed6..8dff14de3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ 1.8.5 () + Fixed bug that was causing the 'completed' report to sort incorrectly. + + Added feature to allow the user to quit when asked to confirm multiple + changes. Now task asks "Proceed with change? (Yes/no/all/quit)". ------ old releases ------------------------------ diff --git a/src/Permission.cpp b/src/Permission.cpp index d70c22b1d..2ea8cff7a 100644 --- a/src/Permission.cpp +++ b/src/Permission.cpp @@ -37,6 +37,7 @@ extern Context context; Permission::Permission () : needConfirmation (false) , allConfirmed (false) +, quit (false) { // Turning confirmations off is the same as entering "all". if (context.config.get ("confirmation", true) == false) @@ -46,6 +47,9 @@ Permission::Permission () //////////////////////////////////////////////////////////////////////////////// bool Permission::confirmed (const Task& task, const std::string& question) { + if (quit) + return false; + if (!needConfirmation) return true; @@ -67,13 +71,15 @@ bool Permission::confirmed (const Task& task, const std::string& question) std::cout << std::endl; - int answer = confirm3 (question); + int answer = confirm4 (question); if (answer == 2) allConfirmed = true; - if (answer > 0) + if (answer == 1 || answer == 2) return true; + if (answer == 3) + quit = true; return false; } diff --git a/src/Permission.h b/src/Permission.h index e3755add2..0d94946a7 100644 --- a/src/Permission.h +++ b/src/Permission.h @@ -44,6 +44,7 @@ public: private: bool needConfirmation; bool allConfirmed; + bool quit; }; #endif diff --git a/src/command.cpp b/src/command.cpp index 490a7bac2..7dad0ebbe 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -829,7 +829,7 @@ int handleDone (std::string &outs) if (taskDiff (before, *task)) { - if (permission.confirmed (before, taskDifferences (before, *task) + "Are you sure?")) + if (permission.confirmed (before, taskDifferences (before, *task) + "Proceed with change?")) { context.tdb.update (*task); @@ -983,7 +983,7 @@ int handleModify (std::string &outs) if (taskDiff (before, *other)) { - if (changes && permission.confirmed (before, taskDifferences (before, *other) + "Are you sure?")) + if (changes && permission.confirmed (before, taskDifferences (before, *other) + "Proceed with change?")) { context.tdb.update (*other); ++count; @@ -1043,7 +1043,7 @@ int handleAppend (std::string &outs) if (taskDiff (before, *other)) { - if (changes && permission.confirmed (before, taskDifferences (before, *other) + "Are you sure?")) + if (changes && permission.confirmed (before, taskDifferences (before, *other) + "Proceed with change?")) { context.tdb.update (*other); @@ -1335,7 +1335,7 @@ int handleAnnotate (std::string &outs) if (taskDiff (before, *task)) { - if (permission.confirmed (before, taskDifferences (before, *task) + "Are you sure?")) + if (permission.confirmed (before, taskDifferences (before, *task) + "Proceed with change?")) { context.tdb.update (*task); diff --git a/src/tests/confirmation.t b/src/tests/confirmation.t index dd9c6bc9e..9ebf21921 100755 --- a/src/tests/confirmation.t +++ b/src/tests/confirmation.t @@ -49,10 +49,10 @@ if (open my $fh, '>', 'response.txt') 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}; -like ($output, qr/Permanently delete task 1 'foo'\? \(y\/n\)/, 'confirmation - yes works'); -unlike ($output, qr/Task not deleted\./, 'confirmation - yes works'); +# Test the various forms of "Yes". +my $output = qx{echo "Yes" | ../task rc:confirm.rc del 1}; +like ($output, qr/Permanently delete task 1 'foo'\? \(y\/n\)/, 'confirmation - Yes works'); +unlike ($output, qr/Task not deleted\./, 'confirmation - Yes works'); $output = qx{echo "ye" | ../task rc:confirm.rc del 2}; like ($output, qr/Permanently delete task 2 'foo'\? \(y\/n\)/, 'confirmation - ye works'); diff --git a/src/tests/util.t.cpp b/src/tests/util.t.cpp index 56038cef8..cabdc59ec 100644 --- a/src/tests/util.t.cpp +++ b/src/tests/util.t.cpp @@ -38,6 +38,7 @@ int main (int argc, char** argv) // TODO bool confirm (const std::string&); // TODO int confirm3 (const std::string&); + // TODO int confirm4 (const std::string&); // TODO void delay (float); // TODO std::string formatSeconds (time_t); // TODO std::string formatSecondsCompact (time_t); @@ -83,15 +84,15 @@ int main (int argc, char** argv) Task rightAgain (right); std::string output = taskDifferences (left, right); - t.ok (taskDiff (left, right), "Detected changes"); - t.ok (output.find ("zero was changed from '0' to '00'") != std::string::npos, "Detected change zero:0 -> zero:00"); - t.ok (output.find ("one was deleted") != std::string::npos, "Detected deletion one:1 ->"); - t.ok (output.find ("two") == std::string::npos, "Detected no change two:2 -> two:2"); - t.ok (output.find ("three was set to '3'") != std::string::npos, "Detected addition -> three:3"); + t.ok (taskDiff (left, right), "Detected changes"); + t.ok (output.find ("zero will be changed from '0' to '00'") != std::string::npos, "Detected change zero:0 -> zero:00"); + t.ok (output.find ("one will be deleted") != std::string::npos, "Detected deletion one:1 ->"); + t.ok (output.find ("two") == std::string::npos, "Detected no change two:2 -> two:2"); + t.ok (output.find ("three will be set to '3'") != std::string::npos, "Detected addition -> three:3"); - t.notok (taskDiff (right, rightAgain), "No changes detected"); + t.notok (taskDiff (right, rightAgain), "No changes detected"); output = taskDifferences (right, rightAgain); - t.ok (output.find ("No changes were made") != std::string::npos, "No changes detected"); + t.ok (output.find ("No changes will be made") != std::string::npos, "No changes detected"); return 0; } diff --git a/src/util.cpp b/src/util.cpp index 75938a318..ba1f6160b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -82,7 +82,7 @@ bool confirm (const std::string& question) int confirm3 (const std::string& question) { std::vector options; - options.push_back ("yes"); + options.push_back ("Yes"); options.push_back ("no"); options.push_back ("all"); @@ -104,11 +104,49 @@ int confirm3 (const std::string& question) } while (matches.size () != 1); - if (matches[0] == "yes") return 1; + if (matches[0] == "Yes") return 1; else if (matches[0] == "all") return 2; else return 0; } +//////////////////////////////////////////////////////////////////////////////// +// 0 = no +// 1 = yes +// 2 = all +// 3 = quit +int confirm4 (const std::string& question) +{ + std::vector options; + options.push_back ("Yes"); + options.push_back ("no"); + options.push_back ("all"); + options.push_back ("quit"); + + std::string answer; + std::vector matches; + + do + { + std::cout << question + << " (" + << options[0] << "/" + << options[1] << "/" + << options[2] << "/" + << options[3] + << ") "; + + std::getline (std::cin, answer); + answer = trim (answer); + autoComplete (answer, options, matches); + } + while (matches.size () != 1); + + if (matches[0] == "Yes") return 1; + else if (matches[0] == "all") return 2; + else if (matches[0] == "quit") return 3; + else return 0; +} + //////////////////////////////////////////////////////////////////////////////// void delay (float f) { @@ -500,12 +538,12 @@ std::string taskDifferences (const Task& before, const Task& after) foreach (name, beforeOnly) out << " - " << *name - << " was deleted\n"; + << " will be deleted\n"; foreach (name, afterOnly) out << " - " << *name - << " was set to '" + << " will be set to '" << renderAttribute (*name, after.get (*name)) << "'\n"; @@ -515,7 +553,7 @@ std::string taskDifferences (const Task& before, const Task& after) before.get (*name) != after.get (*name)) out << " - " << *name - << " was changed from '" + << " will be changed from '" << renderAttribute (*name, before.get (*name)) << "' to '" << renderAttribute (*name, after.get (*name)) @@ -523,7 +561,7 @@ std::string taskDifferences (const Task& before, const Task& after) // Shouldn't just say nothing. if (out.str ().length () == 0) - out << " - No changes were made\n"; + out << " - No changes will be made\n"; return out.str (); } diff --git a/src/util.h b/src/util.h index 2b0b69b01..0a2102abf 100644 --- a/src/util.h +++ b/src/util.h @@ -53,6 +53,7 @@ for (typeof (c) *foreach_p = & (c); \ // util.cpp bool confirm (const std::string&); int confirm3 (const std::string&); +int confirm4 (const std::string&); void delay (float); std::string formatSeconds (time_t); std::string formatSecondsCompact (time_t); From b7726bce21a767d052aa90c8f1a64ba75415c62b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 26 Nov 2009 09:41:47 -0500 Subject: [PATCH 05/23] Bug Fix - #329 task shell convert all characters to lowercase - Fixed bug that inadvertently converted the entire command line to lower case in the shell, rather than just the command, for testing against the "quit" string (thanks to Juergen Daubert). --- AUTHORS | 2 ++ ChangeLog | 2 ++ src/command.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 291ddc51b..570ba41ef 100644 --- a/AUTHORS +++ b/AUTHORS @@ -41,3 +41,5 @@ Thanks to the following, who submitted detailed bug reports and excellent sugges Ian Mortimer Zach Frazier Joe Pulliam + Juergen Daubert + diff --git a/ChangeLog b/ChangeLog index 8dff14de3..851f36d47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ + Fixed bug that was causing the 'completed' report to sort incorrectly. + Added feature to allow the user to quit when asked to confirm multiple changes. Now task asks "Proceed with change? (Yes/no/all/quit)". + + Fixed bug #321 where all shell input was converted to lower case (thanks + to Juergen Daubert). ------ old releases ------------------------------ diff --git a/src/command.cpp b/src/command.cpp index 7dad0ebbe..4dab68b67 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1178,11 +1178,11 @@ void handleShell () command = ""; std::getline (std::cin, command); - command = lowerCase (trim (command)); + command = trim (command); - if (command.length () > 0 && - command.length () <= quit.length () && - command == quit.substr (0, command.length ())) + if (command.length () > 0 && + command.length () <= quit.length () && + lowerCase (command) == quit.substr (0, command.length ())) { keepGoing = false; } From b5f65850f8ce56625cd6f673851f163654b2493a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 Nov 2009 09:53:15 -0500 Subject: [PATCH 06/23] Bug Fix - #327 Deleting due date on recurring task wraps to 1969 - Task now prevents removal of either a due date or a recurrence from a recurring task. --- ChangeLog | 2 ++ src/command.cpp | 9 +++++++ src/tests/bug.327.t | 66 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100755 src/tests/bug.327.t diff --git a/ChangeLog b/ChangeLog index 851f36d47..a0fec7283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ changes. Now task asks "Proceed with change? (Yes/no/all/quit)". + Fixed bug #321 where all shell input was converted to lower case (thanks to Juergen Daubert). + + Fixed bug #327 that allowed the removal of a due date from a recurring + task. ------ old releases ------------------------------ diff --git a/src/command.cpp b/src/command.cpp index 4dab68b67..c359171c7 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -950,6 +950,15 @@ int handleModify (std::string &outs) !task->has ("recur")) throw std::string ("You cannot specify an until date for a non-recurring task."); + if (task->has ("due") && + !context.task.has ("due") && + context.task.has ("recur")) + throw std::string ("You cannot remove the due date from a recurring task."); + + if (task->has ("recur") && + !context.task.has ("recur")) + throw std::string ("You cannot remove the recurrence from a recurring task."); + // Make all changes. foreach (other, all) { diff --git a/src/tests/bug.327.t b/src/tests/bug.327.t new file mode 100755 index 000000000..de8340e0a --- /dev/null +++ b/src/tests/bug.327.t @@ -0,0 +1,66 @@ +#! /usr/bin/perl +################################################################################ +## task - a command line task list manager. +## +## Copyright 2006 - 2009, Paul Beckingham. +## All rights reserved. +## +## This program is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free Software +## Foundation; either version 2 of the License, or (at your option) any later +## version. +## +## This program is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +## FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +## details. +## +## You should have received a copy of the GNU General Public License along with +## this program; if not, write to the +## +## Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, +## Boston, MA +## 02110-1301 +## USA +## +################################################################################ + +use strict; +use warnings; +use Test::More tests => 6; + +# Create the rc file. +if (open my $fh, '>', 'bug.rc') +{ + print $fh "data.location=.\n", + "confirmation=no\n"; + close $fh; + ok (-r 'bug.rc', 'Created bug.rc'); +} + +# Setup: Add a recurring task then remove the due date. +qx{../task rc:bug.rc add foo recur:yearly due:eoy}; +qx{../task rc:bug.rc li}; +qx{../task rc:bug.rc 2 due:}; + +# Result: Somehow the due date is incremented and wraps around to 12/31/1969, +# then keeps going back to today. +my $output = qx{../task rc:bug.rc li}; +like ($output, qr/^1 task$/ms, 'Should only be one task'); + +# Cleanup. +unlink 'pending.data'; +ok (!-r 'pending.data', 'Removed pending.data'); + +unlink 'completed.data'; +ok (!-r 'completed.data', 'Removed completed.data'); + +unlink 'undo.data'; +ok (!-r 'undo.data', 'Removed undo.data'); + +unlink 'bug.rc'; +ok (!-r 'bug.rc', 'Removed bug.rc'); + +exit 0; + From 8d784da0aed461a3f69b2a211d26bb10a00a184d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Nov 2009 08:21:33 -0500 Subject: [PATCH 07/23] Bug Fix = #317, sorting - Fixed bug #317 which colored tasks in the 'completed' report according to due dates, which are no longer relevant to a completed task (thanks to Cory Donnelly). - Fixed bug that was causing the 'completed' report to sort incorrectly. --- ChangeLog | 4 ++++ src/custom.cpp | 1 + src/rules.cpp | 14 ++++++++++---- src/tests/bug.bulk.t | 10 +++++----- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0fec7283..063f7877c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,10 @@ to Juergen Daubert). + Fixed bug #327 that allowed the removal of a due date from a recurring task. + + Fixed bug #317 which colored tasks in the 'completed' report according to + due dates, which are no longer relevant to a completed task (thanks to + Cory Donnelly). + + Fixed bug that was causing the 'completed' report to sort incorrectly. ------ old releases ------------------------------ diff --git a/src/custom.cpp b/src/custom.cpp index 7c9e73d61..4d15779eb 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -461,6 +461,7 @@ int runCustomReport ( std::string column = sortColumn->substr (0, sortColumn->length () - 1); char direction = (*sortColumn)[sortColumn->length () - 1]; + // TODO This code should really be using Att::type. if (column == "id") table.sortOn (columnIndex[column], (direction == '+' ? diff --git a/src/rules.cpp b/src/rules.cpp index 604c5eb3c..484f868a8 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -91,6 +91,8 @@ void autoColorize ( // Note: fg, bg already contain colors specifically assigned via command. // Note: These rules form a hierarchy - the last rule is King. + Task::status status = task.getStatus (); + // Colorization of the tagged. if (gsFg["color.tagged"] != Text::nocolor || gsBg["color.tagged"] != Text::nocolor) @@ -146,9 +148,11 @@ void autoColorize ( } } - // Colorization of the active. - if (gsFg["color.active"] != Text::nocolor || - gsBg["color.active"] != Text::nocolor) + // Colorization of the active, if not completed/deleted. + if ((gsFg["color.active"] != Text::nocolor || + gsBg["color.active"] != Text::nocolor) && + status != Task::completed && + status != Task::deleted) { if (task.has ("start")) { @@ -202,7 +206,9 @@ void autoColorize ( } // Colorization of the due and overdue. - if (task.has ("due")) + if (task.has ("due") && + status != Task::completed && + status != Task::deleted) { std::string due = task.get ("due"); switch (getDueState (due)) diff --git a/src/tests/bug.bulk.t b/src/tests/bug.bulk.t index 2016abc13..5c8d9602c 100755 --- a/src/tests/bug.bulk.t +++ b/src/tests/bug.bulk.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 15; # Create the rc file. if (open my $fh, '>', 'bulk.rc') @@ -49,13 +49,13 @@ qx{../task rc:bulk.rc add t4 due:thursday}; qx{../task rc:bulk.rc add t5 due:friday}; qx{../task rc:bulk.rc add t6 due:saturday}; -my $output = qx{yes|../task rc:bulk.rc pro:p1 pri:M 4 5 6}; +my $output = qx{echo "quit"|../task rc:bulk.rc pro:p1 pri:M 4 5 6}; +like ($output, qr/Modified 0 tasks/, '"quit" prevents any further modifications'); + +my $output = qx{echo "all"|../task rc:bulk.rc pro:p1 pri:M 4 5 6}; unlike ($output, qr/Task 4 "t4"\n - No changes were made/, 'Task 4 modified'); unlike ($output, qr/Task 5 "t5"\n - No changes were made/, 'Task 5 modified'); unlike ($output, qr/Task 6 "t6"\n - No changes were made/, 'Task 6 modified'); -#diag ("---"); -#diag ($output); -#diag ("---"); $output = qx{../task rc:bulk.rc info 4}; like ($output, qr/Project\s+p1/, 'project applied to 4'); From b94706c56e721b9cd233202725f9e10ff45c9138 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Nov 2009 14:23:22 -0500 Subject: [PATCH 08/23] Bug Fix - #322 rc: override for shell command does not propagate - Fixed bug #322 which failed to propagate rc overrides to shell commands. - Context now properly records overrides to file and variables. - The text.cpp:split (...) functions can now skip trivial split results. --- ChangeLog | 1 + src/Context.cpp | 22 +++++++++++++++++----- src/Context.h | 3 ++- src/command.cpp | 17 +++++++---------- src/text.cpp | 12 ++++++++---- src/text.h | 4 ++-- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 063f7877c..dbf7b11b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ due dates, which are no longer relevant to a completed task (thanks to Cory Donnelly). + Fixed bug that was causing the 'completed' report to sort incorrectly. + + Fixed bug #322 which failed to propagate rc overrides to shell commands. ------ old releases ------------------------------ diff --git a/src/Context.cpp b/src/Context.cpp index 1b7ba1072..ed76022ff 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -50,7 +50,8 @@ Context::Context () , tdb () , stringtable () , program ("") -, overrides ("") +, file_override ("") +, var_overrides ("") , cmd () , inShadow (false) { @@ -66,6 +67,7 @@ void Context::initialize (int argc, char** argv) { // Capture the args. for (int i = 0; i < argc; ++i) + { if (i == 0) { program = argv[i]; @@ -76,6 +78,7 @@ void Context::initialize (int argc, char** argv) } else args.push_back (argv[i]); + } initialize (); } @@ -350,13 +353,14 @@ void Context::loadCorrectConfigFile () std::string rc = home + "/.taskrc"; std::string data = home + "/.task"; - // Is there an override for rc? + // Is there an file_override for rc:? foreach (arg, args) { if (*arg == "--") break; else if (arg->substr (0, 3) == "rc:") { + file_override = *arg; rc = arg->substr (3, std::string::npos); home = rc; @@ -380,7 +384,7 @@ void Context::loadCorrectConfigFile () if (config.get ("data.location") != "") data = config.get ("data.location"); - // Is there an override for data? + // Are there any var_overrides for data.location? foreach (arg, args) { if (*arg == "--") @@ -440,7 +444,7 @@ void Context::loadCorrectConfigFile () n.getUntilEOS (value)) { config.set (name, value); - overrides += " " + *arg; + var_overrides += " " + *arg; footnote (std::string ("Configuration override ") + // TODO i18n arg->substr (3, std::string::npos)); } @@ -658,15 +662,21 @@ void Context::parse ( if (parseCmd.command == "" && parseArgs.size () == 0) { // Apply overrides, if any. - std::string defaultCommand = config.get ("default.command") + overrides; + std::string defaultCommand = config.get ("default.command"); if (defaultCommand != "") { + // Add on the overrides. + defaultCommand += " " + file_override + " " + var_overrides; + // Stuff the command line. args.clear (); split (args, defaultCommand, ' '); header ("[task " + defaultCommand + "]"); // Reinitialize the context and recurse. + file_override = ""; + var_overrides = ""; + footnotes.clear (); initialize (); parse (args, cmd, task, sequence, subst, filter); } @@ -691,6 +701,8 @@ void Context::clear () // stringtable.clear (); program = ""; args.clear (); + file_override = ""; + var_overrides = ""; cmd.command = ""; tagAdditions.clear (); tagRemovals.clear (); diff --git a/src/Context.h b/src/Context.h index e903bb8a7..bf56675bc 100644 --- a/src/Context.h +++ b/src/Context.h @@ -83,7 +83,8 @@ public: StringTable stringtable; std::string program; std::vector args; - std::string overrides; + std::string file_override; + std::string var_overrides; Cmd cmd; std::map aliases; std::vector tagAdditions; diff --git a/src/command.cpp b/src/command.cpp index c359171c7..2609d22a9 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1169,13 +1169,9 @@ void handleShell () << std::endl << std::endl; - // Preserve any special override arguments, and reapply them for each - // shell command. - std::vector special; - foreach (arg, context.args) - if (arg->substr (0, 3) == "rc." || - arg->substr (0, 3) == "rc:") - special.push_back (*arg); + // Make a copy because context.clear will delete them. + std::string permanentOverrides = " " + context.file_override + + " " + context.var_overrides; std::string quit = "quit"; // TODO i18n std::string command; @@ -1187,8 +1183,10 @@ void handleShell () command = ""; std::getline (std::cin, command); - command = trim (command); + std::string decoratedCommand = trim (command + permanentOverrides); + // When looking for the 'quit' command, use 'command', not + // 'decoratedCommand'. if (command.length () > 0 && command.length () <= quit.length () && lowerCase (command) == quit.substr (0, command.length ())) @@ -1202,8 +1200,7 @@ void handleShell () context.clear (); std::vector args; - split (args, command, ' '); - foreach (arg, special) context.args.push_back (*arg); + split (args, decoratedCommand, ' '); foreach (arg, args) context.args.push_back (*arg); context.initialize (); diff --git a/src/text.cpp b/src/text.cpp index d980b7c34..793ebc0f1 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -57,14 +57,16 @@ void wrapText ( void split ( std::vector& results, const std::string& input, - const char delimiter) + const char delimiter, + bool nontrivial /* = true */) { results.clear (); std::string::size_type start = 0; std::string::size_type i; while ((i = input.find (delimiter, start)) != std::string::npos) { - results.push_back (input.substr (start, i - start)); + if (!nontrivial || i != start) + results.push_back (input.substr (start, i - start)); start = i + 1; } @@ -76,7 +78,8 @@ void split ( void split ( std::vector& results, const std::string& input, - const std::string& delimiter) + const std::string& delimiter, + bool nontrivial /* = true */) { results.clear (); std::string::size_type length = delimiter.length (); @@ -85,7 +88,8 @@ void split ( std::string::size_type i; while ((i = input.find (delimiter, start)) != std::string::npos) { - results.push_back (input.substr (start, i - start)); + if (!nontrivial || i != start) + results.push_back (input.substr (start, i - start)); start = i + length; } diff --git a/src/text.h b/src/text.h index 95eb718a7..bb82cb6fa 100644 --- a/src/text.h +++ b/src/text.h @@ -38,8 +38,8 @@ std::string trimRight (const std::string& in, const std::string& t = " "); std::string trim (const std::string& in, const std::string& t = " "); std::string unquoteText (const std::string&); void extractLine (std::string&, std::string&, int); -void split (std::vector&, const std::string&, const char); -void split (std::vector&, const std::string&, const std::string&); +void split (std::vector&, const std::string&, const char, bool nontrivial = true); +void split (std::vector&, const std::string&, const std::string&, bool nontrivial = true); void join (std::string&, const std::string&, const std::vector&); std::string commify (const std::string&); std::string lowerCase (const std::string&); From 00b246ce8aa9ea63b17b6966f056008ef680aeb9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Nov 2009 16:17:26 -0500 Subject: [PATCH 09/23] Bug Fix - shell mode - Removed redundant messages when exiting shell mode. --- ChangeLog | 1 + src/command.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index dbf7b11b0..14bff99ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ Cory Donnelly). + Fixed bug that was causing the 'completed' report to sort incorrectly. + Fixed bug #322 which failed to propagate rc overrides to shell commands. + + Fixed redundant messages when exiting shell mode. ------ old releases ------------------------------ diff --git a/src/command.cpp b/src/command.cpp index 2609d22a9..964d7d669 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1219,6 +1219,9 @@ void handleShell () } } while (keepGoing && !std::cin.eof ()); + + // No need to repeat any overrides after the shell quits. + context.clearMessages (); } #endif From b3db2245faafe65759b2404e9714b9ec8779de27 Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Mon, 30 Nov 2009 00:16:10 +0100 Subject: [PATCH 10/23] Updated OS that task runs on --- NEWS | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 6a358f0b1..160ab2fde 100644 --- a/NEWS +++ b/NEWS @@ -16,17 +16,19 @@ New Features in task 1.8 Task has been built and tested on the following configurations: - - OS X 10.6 Snow Leopard and 10.5 Leopard - - Fedora 11 Leonidas and 10 Cambridge - - Ubuntu 9.04 Jaunty Jackalope and 8.10 Intrepid Ibex - - Slackware 12.2 - - Arch Linux - - Gentoo Linux - - Solaris 10 and 8 - - OpenBSD 4.5 - - FreeBSD - - Cygwin 1.5 - - Haiku R1/alpha1 + * OS X 10.6 Snow Leopard and 10.5 Leopard + * Fedora 12 Constantine and 11 Leonidas + * Ubuntu 9.10 Karmic Koala and 9.04 Jaunty Jackalope + * Slackware 12.2 + * Arch Linux + * Gentoo Linux + * SliTaz Linux + * CRUX Linux + * Solaris 10 and 8 + * OpenBSD 4.5 + * FreeBSD + * Cygwin 1.5 + * Haiku R1/alpha1 While Task has undergone testing, bugs are sure to remain. If you encounter a bug, please enter a new issue at: From b246fae8897070ddf5993bb932d1b57755847383 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 29 Nov 2009 22:41:55 -0500 Subject: [PATCH 11/23] Unit Tests - fixing broken tests - The split tests are all broken after a recent change. They need to be extended to accommodate the new split_minimal functions. --- src/tests/text.t.cpp | 17 +++++++++++++++ src/text.cpp | 50 ++++++++++++++++++++++++++++++++++++++------ src/text.h | 6 ++++-- 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/tests/text.t.cpp b/src/tests/text.t.cpp index e1813aa1b..a3d1c7371 100644 --- a/src/tests/text.t.cpp +++ b/src/tests/text.t.cpp @@ -104,12 +104,19 @@ int main (int argc, char** argv) t.is (items.size (), (size_t) 1, "split 'a' '-' -> 1 item"); t.is (items[0], "a", "split 'a' '-' -> 'a'"); + split (items, unsplit, '-'); + t.is (items.size (), (size_t) 1, "split 'a' '-' -> 1 item"); + t.is (items[0], "a", "split 'a' '-' -> 'a'"); + unsplit = "-"; split (items, unsplit, '-'); t.is (items.size (), (size_t) 2, "split '-' '-' -> '' ''"); t.is (items[0], "", "split '-' '-' -> [0] ''"); t.is (items[1], "", "split '-' '-' -> [1] ''"); + split (items, unsplit, '-'); + t.is (items.size (), (size_t) 1, "split '-' '-' -> '-'"); + unsplit = "-a-bc-def"; split (items, unsplit, '-'); t.is (items.size (), (size_t) 4, "split '-a-bc-def' '-' -> '' 'a' 'bc' 'def'"); @@ -118,11 +125,21 @@ int main (int argc, char** argv) t.is (items[2], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); t.is (items[3], "def", "split '-a-bc-def' '-' -> [3] 'def'"); + split (items, unsplit, '-'); + t.is (items.size (), (size_t) 3, "split '-a-bc-def' '-' -> 'a' 'bc' 'def'"); + t.is (items[0], "a", "split '-a-bc-def' '-' -> [1] 'a'"); + t.is (items[1], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); + t.is (items[2], "def", "split '-a-bc-def' '-' -> [3] 'def'"); + // void split (std::vector& results, const std::string& input, const std::string& delimiter) unsplit = ""; split (items, unsplit, "--"); t.is (items.size (), (size_t) 0, "split '' '--' -> 0 items"); + split (items, unsplit, "--"); + t.is (items.size (), (size_t) 1, "split '' '--' -> 1"); + t.is (items[0], "", "split '' '--' -> [1] ''"); + unsplit = "a"; split (items, unsplit, "--"); t.is (items.size (), (size_t) 1, "split 'a' '--' -> 1 item"); diff --git a/src/text.cpp b/src/text.cpp index 793ebc0f1..727bfd811 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -57,15 +57,33 @@ void wrapText ( void split ( std::vector& results, const std::string& input, - const char delimiter, - bool nontrivial /* = true */) + const char delimiter) { results.clear (); std::string::size_type start = 0; std::string::size_type i; while ((i = input.find (delimiter, start)) != std::string::npos) { - if (!nontrivial || i != start) + results.push_back (input.substr (start, i - start)); + start = i + 1; + } + + if (input.length ()) + results.push_back (input.substr (start, std::string::npos)); +} + +//////////////////////////////////////////////////////////////////////////////// +void split_minimal ( + std::vector& results, + const std::string& input, + const char delimiter) +{ + results.clear (); + std::string::size_type start = 0; + std::string::size_type i; + while ((i = input.find (delimiter, start)) != std::string::npos) + { + if (i != start) results.push_back (input.substr (start, i - start)); start = i + 1; } @@ -78,8 +96,7 @@ void split ( void split ( std::vector& results, const std::string& input, - const std::string& delimiter, - bool nontrivial /* = true */) + const std::string& delimiter) { results.clear (); std::string::size_type length = delimiter.length (); @@ -88,7 +105,28 @@ void split ( std::string::size_type i; while ((i = input.find (delimiter, start)) != std::string::npos) { - if (!nontrivial || i != start) + results.push_back (input.substr (start, i - start)); + start = i + length; + } + + if (input.length ()) + results.push_back (input.substr (start, std::string::npos)); +} + +//////////////////////////////////////////////////////////////////////////////// +void split_minimal ( + std::vector& results, + const std::string& input, + const std::string& delimiter) +{ + results.clear (); + std::string::size_type length = delimiter.length (); + + std::string::size_type start = 0; + std::string::size_type i; + while ((i = input.find (delimiter, start)) != std::string::npos) + { + if (i != start) results.push_back (input.substr (start, i - start)); start = i + length; } diff --git a/src/text.h b/src/text.h index bb82cb6fa..e23864cd8 100644 --- a/src/text.h +++ b/src/text.h @@ -38,8 +38,10 @@ std::string trimRight (const std::string& in, const std::string& t = " "); std::string trim (const std::string& in, const std::string& t = " "); std::string unquoteText (const std::string&); void extractLine (std::string&, std::string&, int); -void split (std::vector&, const std::string&, const char, bool nontrivial = true); -void split (std::vector&, const std::string&, const std::string&, bool nontrivial = true); +void split (std::vector&, const std::string&, const char); +void split (std::vector&, const std::string&, const std::string&); +void split_minimal (std::vector&, const std::string&, const char); +void split_minimal (std::vector&, const std::string&, const std::string&); void join (std::string&, const std::string&, const std::vector&); std::string commify (const std::string&); std::string lowerCase (const std::string&); From 7f11f1b560b4a486fa7321ab264d6cf1aa65dede Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Tue, 1 Dec 2009 23:00:40 +0100 Subject: [PATCH 12/23] Bug Fix - #333 duplicate command should display the ID of the created task - Added missing "Created task" output to duplicate command (thanks to Cory Donnelly). --- src/command.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 964d7d669..c2aede783 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -1140,12 +1140,21 @@ int handleDuplicate (std::string &outs) ++count; } + if (context.config.get ("echo.command", true)) + { + out << "Duplicated " << count << " task" << (count == 1 ? "" : "s") << std::endl; +#ifdef FEATURE_NEW_ID + // All this, just for an id number. + std::vector all; + Filter none; + context.tdb.loadPending (all, none); + out << "Created task " << context.tdb.nextId () << std::endl; +#endif + } + context.tdb.commit (); context.tdb.unlock (); - if (context.config.get ("echo.command", true)) - out << "Duplicated " << count << " task" << (count == 1 ? "" : "s") << std::endl; - outs = out.str (); return 0; } From 2b44d513e87ac69c350f95923c64a0eef5e15dbc Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Wed, 2 Dec 2009 00:28:34 +0100 Subject: [PATCH 13/23] Added unit tests for bug fix #333 --- src/tests/duplicate.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/duplicate.t b/src/tests/duplicate.t index 19ea26911..f148e7b03 100755 --- a/src/tests/duplicate.t +++ b/src/tests/duplicate.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 12; +use Test::More tests => 15; # Create the rc file. if (open my $fh, '>', 'dup.rc') @@ -55,6 +55,12 @@ like ($output, qr/Description\s+FOO/, 'duplicate modified description'); like ($output, qr/Priority\s+H/, 'duplicate added priority'); like ($output, qr/Tags\s+tag/, 'duplicate added tag'); +# Test the output of the duplicate command - returning id of duplicated task +$output = qx{../task rc:dup.rc duplicate 1}; +like ($output, qr/Duplicated\s+1\s+'foo'/, 'duplicate output task id and description'); +like ($output, qr/Duplicated\s+1\s+task/, 'duplicate output number of tasks duplicated'); +like ($output, qr/Created\s+task\s+4/, 'duplicate output of new task id'); + # Cleanup. unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); From d4910f65ebbdcd6b340eabe89853e9e864e1488b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 1 Dec 2009 22:12:59 -0500 Subject: [PATCH 14/23] Bug Fix - #332 output field "recur_ind" not valid? - Fixed bug #332 where task complained that the 'recur_ind' custom report column was invalid. It was misnamed in the documentation, which should have read 'recurrence_indicator'. Also, the 'tag_indicator' column was not mentioned anywhere (thanks to T. Charles Yun). - Added ChangeLog entry for the #333 fix. --- ChangeLog | 6 ++++++ src/Config.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14bff99ff..4b8fb7539 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,12 @@ + Fixed bug that was causing the 'completed' report to sort incorrectly. + Fixed bug #322 which failed to propagate rc overrides to shell commands. + Fixed redundant messages when exiting shell mode. + + Fixed bug #333 which failed to display the ID of a duplicated task (thanks + to Cory Donnelly). + + Fixed bug #332 where task complained that the 'recur_ind' custom report + column was invalid. It was misnamed in the documentation, which should + have read 'recurrence_indicator'. Also, the 'tag_indicator' column was + not mentioned anywhere (thanks to T. Charles Yun). ------ old releases ------------------------------ diff --git a/src/Config.cpp b/src/Config.cpp index c34654d95..b99a98acb 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -150,8 +150,8 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data) << "#default.priority=M # Unless otherwise specified\n" << "default.command=list # Unless otherwise specified\n" << "\n" - << "# Fields: id,uuid,project,priority,entry,start,due,recur,recur_ind,age,\n" - << "# age_compact,active,tags,description,description_only\n" + << "# Fields: id,uuid,project,priority,entry,start,due,recur,recurrence_indicator,age,\n" + << "# age_compact,active,tags,tag_indicator,description,description_only\n" << "# Description: This report is ...\n" << "# Sort: due+,priority-,project+\n" << "# Filter: pro:x pri:H +bug limit:10\n" From 1d80a2ebdc0169a080abfbe95319041a3b7a0c47 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 1 Dec 2009 23:29:01 -0500 Subject: [PATCH 15/23] Unit Tests - default.t - The fix to bug #322 means the way default commands are specified is now a little different. If the command "task rc:x" is run, the default command no longer needs to also include "rc:x". --- src/tests/default.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/default.t b/src/tests/default.t index b80e81a0e..d452a5a4e 100755 --- a/src/tests/default.t +++ b/src/tests/default.t @@ -34,7 +34,7 @@ use Test::More tests => 17; if (open my $fh, '>', 'default.rc') { print $fh "data.location=.\n", - "default.command=rc:default.rc list\n", + "default.command=list\n", "default.project=PROJECT\n", "default.priority=M\n"; close $fh; From 13955bc6aeb4d5f52578d343971f82d9f53da7fa Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 1 Dec 2009 23:41:44 -0500 Subject: [PATCH 16/23] Unit Tests - text.t - Added more unit tests to cover the new split_minimal function. --- src/tests/text.t.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/tests/text.t.cpp b/src/tests/text.t.cpp index a3d1c7371..b0437c1d6 100644 --- a/src/tests/text.t.cpp +++ b/src/tests/text.t.cpp @@ -34,7 +34,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (109); + UnitTest t (117); // void wrapText (std::vector & lines, const std::string& text, const int width) std::string text = "This is a test of the line wrapping code."; @@ -114,7 +114,7 @@ int main (int argc, char** argv) t.is (items[0], "", "split '-' '-' -> [0] ''"); t.is (items[1], "", "split '-' '-' -> [1] ''"); - split (items, unsplit, '-'); + split_minimal (items, unsplit, '-'); t.is (items.size (), (size_t) 1, "split '-' '-' -> '-'"); unsplit = "-a-bc-def"; @@ -125,7 +125,7 @@ int main (int argc, char** argv) t.is (items[2], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); t.is (items[3], "def", "split '-a-bc-def' '-' -> [3] 'def'"); - split (items, unsplit, '-'); + split_minimal (items, unsplit, '-'); t.is (items.size (), (size_t) 3, "split '-a-bc-def' '-' -> 'a' 'bc' 'def'"); t.is (items[0], "a", "split '-a-bc-def' '-' -> [1] 'a'"); t.is (items[1], "bc", "split '-a-bc-def' '-' -> [2] 'bc'"); @@ -136,9 +136,8 @@ int main (int argc, char** argv) split (items, unsplit, "--"); t.is (items.size (), (size_t) 0, "split '' '--' -> 0 items"); - split (items, unsplit, "--"); - t.is (items.size (), (size_t) 1, "split '' '--' -> 1"); - t.is (items[0], "", "split '' '--' -> [1] ''"); + split_minimal (items, unsplit, "--"); + t.is (items.size (), (size_t) 0, "split '' '--' -> 0"); unsplit = "a"; split (items, unsplit, "--"); From 2c0da3522594f94186c6b7155994db26a065d476 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 2 Dec 2009 00:13:37 -0500 Subject: [PATCH 17/23] Bug Fix - #319 Removing tag from many tasks, incorrect change summary - Fixed bug that caused task to not properly detect the removal of a tag when obtaining confirmation from the user fora bulk modification (thanks to Cory Donnelly). --- ChangeLog | 3 +++ src/util.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4b8fb7539..948d177be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,9 @@ column was invalid. It was misnamed in the documentation, which should have read 'recurrence_indicator'. Also, the 'tag_indicator' column was not mentioned anywhere (thanks to T. Charles Yun). + + Fixed bug #319 that caused task to not properly detect the removal of a + tag when obtaining confirmation from the user fora bulk modification + (thanks to Cory Donnelly). ------ old releases ------------------------------ diff --git a/src/util.cpp b/src/util.cpp index ba1f6160b..a61ac0fd5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -549,7 +549,6 @@ std::string taskDifferences (const Task& before, const Task& after) foreach (name, beforeAtts) if (*name != "uuid" && - after.get (*name) != "" && before.get (*name) != after.get (*name)) out << " - " << *name From 3b354b6d47ca465d85bad7c867cf5ea2de6f0ed1 Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Wed, 2 Dec 2009 21:41:20 +0100 Subject: [PATCH 18/23] Bug Fix - #332 output field "recur_ind" not valid? - changed man page to include the correct fields --- doc/man/taskrc.5 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/man/taskrc.5 b/doc/man/taskrc.5 index 951b7e0b0..e3dc2ace7 100644 --- a/doc/man/taskrc.5 +++ b/doc/man/taskrc.5 @@ -384,8 +384,9 @@ The description for report X when running the "task help" command. .TP .B report.X.columns The columns that will be used when generating the report X. Valid columns are: -id, uuid, project, priority, entry, start, due, recur, recur_ind, age, age_compact, -active, tags, description, description_only. The IDs are separated by commas. +id, uuid, project, priority, entry, start, due, recur, recur_indicator, age, +age_compact, active, tags, tag_indicator, description, description_only. +The IDs are separated by commas. .TP .B report.X.labels From e717345f2035fd809b3df56261a06e962db83a9f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 12 Nov 2009 08:53:06 -0500 Subject: [PATCH 19/23] Feature - #310 'task add' with external editor - Simplified and make clearer and error message that complained about things that were beyond user control (thanks to John Florian). (cherry picked from commit a2152628251c6d8c9bc840b8f36851f4ce680c99) Signed-off-by: Paul Beckingham --- src/Task.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Task.cpp b/src/Task.cpp index c8c9d6e07..2f49c6ab1 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -527,7 +527,7 @@ void Task::validate () const if (!has ("uuid") || !has ("entry") || !has ("description")) - throw std::string ("A task must have a uuid, entry date and description in order to be valid."); // TODO i18n + throw std::string ("A task must have a description in order to be valid."); // TODO i18n if (get ("description") == "") // No i18n throw std::string ("Cannot add a task that is blank, or contains or characters."); // TODO i18n From b3e3c36d50d1d8a3edafdf5840348dfa7d05b779 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 5 Dec 2009 12:46:29 -0500 Subject: [PATCH 20/23] Documentation Update - Added missing ChangeLog entry for #310. --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 948d177be..1b1d93f8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,9 @@ + Fixed bug #319 that caused task to not properly detect the removal of a tag when obtaining confirmation from the user fora bulk modification (thanks to Cory Donnelly). + + Added feature - #310 that simplified and make clearer an error message + that complained about things that were beyond user control (thanks to + John Florian). ------ old releases ------------------------------ From 204d287b2093533f805c5549eb11664480f06e31 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 5 Dec 2009 11:24:05 -0500 Subject: [PATCH 21/23] Feature - #341 man pages - Added feature #341 that makes explicit references to the task and taskrc man pages, both in the auto-generated .taskrc file and the version command output (thanks to Cory Donnelly). Signed-off-by: Federico Hernandez --- ChangeLog | 17 ++++++++++------- src/Config.cpp | 2 +- src/command.cpp | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b1d93f8a..ab8f27b73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,16 +2,22 @@ ------ current release --------------------------- 1.8.5 () - + Fixed bug that was causing the 'completed' report to sort incorrectly. + Added feature to allow the user to quit when asked to confirm multiple changes. Now task asks "Proceed with change? (Yes/no/all/quit)". + + Added feature #341 that makes explicit references to the task and taskrc + man pages, both in the auto-generated .taskrc file and the version command + output (thanks to Cory Donnelly). + + Added feature - #310 that simplified and make clearer an error message + that complained about things that were beyond user control (thanks to + John Florian). + + Fixed bug that was causing the 'completed' report to sort incorrectly. + Fixed bug #321 where all shell input was converted to lower case (thanks to Juergen Daubert). + Fixed bug #327 that allowed the removal of a due date from a recurring task. - + Fixed bug #317 which colored tasks in the 'completed' report according to - due dates, which are no longer relevant to a completed task (thanks to - Cory Donnelly). + + Fixed bug #317 which colored tasks in the 'completed' report according + to due dates, which are no longer relevant to a completed task (thanks + to Cory Donnelly). + Fixed bug that was causing the 'completed' report to sort incorrectly. + Fixed bug #322 which failed to propagate rc overrides to shell commands. + Fixed redundant messages when exiting shell mode. @@ -24,9 +30,6 @@ + Fixed bug #319 that caused task to not properly detect the removal of a tag when obtaining confirmation from the user fora bulk modification (thanks to Cory Donnelly). - + Added feature - #310 that simplified and make clearer an error message - that complained about things that were beyond user control (thanks to - John Florian). ------ old releases ------------------------------ diff --git a/src/Config.cpp b/src/Config.cpp index b99a98acb..4f2d657e1 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -100,7 +100,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data) // Create a sample .taskrc file. std::stringstream contents; contents << "# Task program configuration file.\n" - << "# For more documentation, see http://taskwarrior.org\n" + << "# For more documentation, see http://taskwarrior.org or try 'man task' and 'man taskrc'\n" << "\n" << "# Files\n" << "data.location=" << data << "\n" diff --git a/src/command.cpp b/src/command.cpp index c2aede783..f3b4d86c1 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -436,7 +436,7 @@ int handleVersion (std::string &outs) link.addCell (link.addRow (), 0, "See http://taskwarrior.org for the latest releases, online documentation " "and lively discussion. New releases containing fixes and enhancements " - "are made frequently."); + "are made frequently. Don't forget the man pages 'man task' and 'man taskrc'."); std::vector all; context.config.all (all); From a6c7236ff34e5eee3ef1693b97cb1367e6e3c607 Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Sun, 6 Dec 2009 01:49:05 +0100 Subject: [PATCH 22/23] Release date for 1.8.5 --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab8f27b73..4e8b72931 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ ------ current release --------------------------- -1.8.5 () +1.8.5 (12/05/2009) + Added feature to allow the user to quit when asked to confirm multiple changes. Now task asks "Proceed with change? (Yes/no/all/quit)". + Added feature #341 that makes explicit references to the task and taskrc From 28377502f6990341d51d06bbebd847a752cf24b4 Mon Sep 17 00:00:00 2001 From: Federico Hernandez Date: Sun, 6 Dec 2009 04:14:40 +0100 Subject: [PATCH 23/23] Added SHA1 of taged release commit --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4e8b72931..92089b90f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ ------ current release --------------------------- -1.8.5 (12/05/2009) +1.8.5 (12/05/2009) a6c7236ff34e5eee3ef1693b97cb1367e6e3c607 + Added feature to allow the user to quit when asked to confirm multiple changes. Now task asks "Proceed with change? (Yes/no/all/quit)". + Added feature #341 that makes explicit references to the task and taskrc