[ditz-talk] [PATCH] Fix done/not done behaviour

Pavel Shramov shramov at mexmat.net
Tue Sep 16 16:01:51 EDT 2008


From: Pavel Shramov <psha at qwe.ipib.msu.ru>

PERCENT-DONE is set to 100 only when release is released
otherwise it has maximum of 99
---
 lib/ditz/operator.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/ditz/operator.rb b/lib/ditz/operator.rb
index e428ac2..1fe6d90 100644
--- a/lib/ditz/operator.rb
+++ b/lib/ditz/operator.rb
@@ -357,8 +357,9 @@ EOS
     releases.each do |r|
       issues = project.issues_for_release r
       done = 0
-      done = (100 * (issues.select { |i| i.closed? }).length / issues.length).to_int if issues.length != 0
+      done = (99 * (issues.select { |i| i.closed? }).length / issues.length).to_int if issues.length != 0
       if r != :unassigned
+        done = 100 if r.released?
         parent = "release-#{r.hash}"
         title = "Release #{r.name} (#{r.status})"
       else
-- 
1.5.6.3


More information about the ditz-talk mailing list