diff --git a/ChangeLog b/ChangeLog index 618a3cd91..d08f8204c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -111,6 +111,7 @@ - TW-1341 confirmation config setting should apply to config command as well (thanks to Charles Ulrich). - TW-1345 taskrc.5 manpage errors. +- TW-1360 color.until directive missing. - TW-1361 Strange results with complex filter (thanks to Jim B). - TW-1366 In diagnostics it's called 'Cert', and in config it's called 'certificate' (thanks to Jack). diff --git a/NEWS b/NEWS index 77eb3f341..616879713 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ New Features in taskwarrior 2.4.0 command. - The 'new-uuid' verbosity token shows the UUID of newly created tasks. - The 'info' report now breaks down urgency values. + - New 'color.until' color rule. New commands in taskwarrior 2.4.0 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index cd33b0c57..11699e61b 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -760,6 +760,9 @@ Task is started, therefore active. .B color.scheduled Task is scheduled, therefore ready for work. .br +.B color.until +Task has an expiration date. +.br .B color.blocking Task is blocking another in a dependency. .br diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index f541c6928..9375ec9cd 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -121,6 +121,7 @@ int CmdShow::execute (std::string& output) " color.tagged" " color.undo.after" " color.undo.before" + " color.until" " column.padding" " complete.all.tags" " confirmation" diff --git a/src/rules.cpp b/src/rules.cpp index 0e6015d26..613229421 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -151,6 +151,13 @@ static void colorizeScheduled (Task& task, const Color& base, Color& c) c.blend (base); } +//////////////////////////////////////////////////////////////////////////////// +static void colorizeUntil (Task& task, const Color& base, Color& c) +{ + if (task.has ("until")) + c.blend (base); +} + //////////////////////////////////////////////////////////////////////////////// static void colorizeTag (Task& task, const std::string& rule, const Color& base, Color& c) { @@ -312,6 +319,7 @@ void autoColorize (Task& task, Color& c) else if (*r == "color.pri.none") colorizePriorityNone (task, base, c); else if (*r == "color.active") colorizeActive (task, base, c); else if (*r == "color.scheduled") colorizeScheduled (task, base, c); + else if (*r == "color.until") colorizeUntil (task, base, c); else if (*r == "color.project.none") colorizeProjectNone (task, base, c); else if (*r == "color.tag.none") colorizeTagNone (task, base, c); else if (*r == "color.due") colorizeDue (task, base, c); diff --git a/test/tw-1306.t b/test/tw-1306.t index 9a3000f5d..2b3469351 100755 --- a/test/tw-1306.t +++ b/test/tw-1306.t @@ -28,7 +28,6 @@ import sys import os -# Ensure python finds the local simpletap and basetest modules sys.path.append(os.path.dirname(os.path.abspath(__file__))) from basetest import BaseTestCase @@ -41,7 +40,7 @@ class BaseTestBug1306(BaseTestCase): "confirmation=no\n") class TestBug1306(BaseTestBug1306): - def test_overdue(self): + def test_mod_before_add(self): """FILTER before 'add' command upgraded to MODIFICATION""" self.callTaskSuccess(["rc:1306.rc", "project:PROJ", "add", "foo"]) code, out, err = self.callTaskSuccess(["rc:1306.rc", "1", "info"])