From af75fa8b05a3400612fdee96424ef147f586f933 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Jul 2014 17:19:29 -0400 Subject: [PATCH] TW-296 - TW-296 urgency of blocked task should affect urgency of blocking task (thanks to Sitaram Chamarty). --- AUTHORS | 1 + ChangeLog | 2 ++ NEWS | 2 ++ doc/man/taskrc.5.in | 4 ++++ src/Task.cpp | 27 +++++++++++++-------------- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/AUTHORS b/AUTHORS index 034553b80..edd0d8f81 100644 --- a/AUTHORS +++ b/AUTHORS @@ -221,3 +221,4 @@ suggestions: Charles Ulrich Jack Kevin Ballard + Sitaram Chamarty diff --git a/ChangeLog b/ChangeLog index 06c4298e0..37e5a150a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -66,6 +66,8 @@ - TW-288 `task edit` mangles descriptions with embedded newlines (thanks to Kevin Ballard). - TW-294 Display UUID of task created by add (thanks to John West). +- TW-296 urgency of blocked task should affect urgency of blocking task (thanks + to Sitaram Chamarty). - TW-306 Wrong date format in burndown view (thanks to Michele Santullo). - TW-752 task ID no longer defaults to info (thanks to Christopher Roberts). - TW-1243 Automatically insert ( ) around user-supplied filter, if any. diff --git a/NEWS b/NEWS index 54c15d5e0..f9b69c906 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ New Features in taskwarrior 2.4.0 - 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. + - Using a non-zero 'urgency.inherit.coefficient' value means a task inherits + the urgency values of the dependency chain. New commands in taskwarrior 2.4.0 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index f896b0042..7969675f1 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -999,6 +999,10 @@ Urgency coefficient for blocking tasks .RS Urgency coefficient for blocked tasks .RE +.B urgency.inherit.coefficient=0.0 +.RS +Urgency inherited from dependency chain +.RE .B urgency.due.coefficient=12.0 .RS Urgency coefficient for due dates diff --git a/src/Task.cpp b/src/Task.cpp index 6767dba2a..652492eb8 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -1800,28 +1800,27 @@ float Task::urgency_inherit () const if (!is_blocking) return 0.0; - std::vector blocked; - std::vector ::const_iterator it; - float v = 0.0; - // Calling dependencyGetBlocked is rather expensive. // It is called recursively for each dependency in the chain here. - // Paul is going to kill me. :) + std::vector blocked; dependencyGetBlocked (*this, blocked); + + float v = 0.0; + std::vector ::const_iterator it; for (it = blocked.begin (); it != blocked.end (); ++it) { // urgency_blocked, _blocking, _project and _tags left out. - v += it->urgency_active(); - v += it->urgency_age(); - v += it->urgency_annotations(); - v += it->urgency_due(); - v += it->urgency_next(); - v += it->urgency_priority(); - v += it->urgency_scheduled(); - v += it->urgency_waiting(); + v += it->urgency_active (); + v += it->urgency_age (); + v += it->urgency_annotations (); + v += it->urgency_due (); + v += it->urgency_next (); + v += it->urgency_priority (); + v += it->urgency_scheduled (); + v += it->urgency_waiting (); // Inherit from all parent tasks in the dependency chain recursively. - v += it->urgency_inherit(); + v += it->urgency_inherit (); } return v;