Permalink
Browse files

Fix: Don't ignore provided start/end date when deps are present.

Reported-by: Willem Langers
  • Loading branch information...
1 parent 95a9967 commit ea62086ea9f23c2e15812fc85d9da6967325360a @scrapper scrapper committed Jun 22, 2013
Showing with 34 additions and 0 deletions.
  1. +9 −0 lib/taskjuggler/TaskScenario.rb
  2. +25 −0 test/TestSuite/Scheduler/Correct/DateAndDep.tjp
@@ -996,6 +996,15 @@ def propagateDate(date, atEnd, ignoreEffort = false)
# For leaf tasks, propagate start may set the date. Container task dates
# are only set in scheduleContainer().
if @property.leaf?
+ # If we already have a date, we will only shrink the task period with
+ # the new date.
+ if (setDate = instance_variable_get('@' + thisEnd)) &&
+ atEnd ? date > setDate : date < setDate
+ Log.msg { "Preserving #{thisEnd} date of #{typename} " +
+ "#{@property.fullId}: #{setDate}" }
+ return
+ end
+
instance_variable_set(('@' + thisEnd).intern, date)
typename = 'Task'
if @durationType == :startEndTask
@@ -0,0 +1,25 @@
+project "Date and dependency" 2013-06-22 +2m
+
+include "checks.tji"
+
+resource r "R"
+
+task "Forward" {
+ task t1 "T1" {
+ start 2013-06-24
+ effort 2d
+ allocate r
+ }
+ task t2 "T2" {
+ depends !t1 { onstart }
+ start 2013-06-27
+ effort 2d
+ allocate r
+ ${FixStart "2013-06-27-9:00"}
+ }
+}
+
+taskreport "DateAndDep" {
+ formats html
+ columns no, name, start, end, chart
+}

0 comments on commit ea62086

Please sign in to comment.