[Gridflow-cvs] [svn] commit: r4704 - /trunk/bin/plusminus

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Nov 2 16:40:05 EST 2009


Author: matju
Date: Mon Nov  2 16:40:05 2009
New Revision: 4704

Log:
new version updated for svn, also fixing some bugs (replacing them by different bugs)

Modified:
    trunk/bin/plusminus

Modified: trunk/bin/plusminus
==============================================================================
--- trunk/bin/plusminus (original)
+++ trunk/bin/plusminus Mon Nov  2 16:40:05 2009
@@ -1,30 +1,30 @@
 #!/usr/bin/env ruby
-# NOTE: this works with diff -u only!!!
+# NOTE: this works with svn diff -u only!!!
 
-puts "-"*64
+puts "-"*72
 
 $plustot=0
 $minustot=0
 
 def show
-  printf "%20s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus
+  printf "%40s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus
 end
 
 loop{
   line = gets
   break if not line
-  if /^diff/.match line then
+  if /^\+\+\+/.match line then
     x = line.split(/\s+/)
     $plustot+=$plus if $plus
     $minustot+=$minus if $minus
     show if $file
-    $file = x[-1]
+    $file = x[1]
     $on=false
     $plus=0
     $minus=0
   elsif /^\@\@/ =~ line then $on=true
-  elsif $on and /^\+/ =~ line then $plus+=1
-  elsif $on and /^\-/ =~ line then $minus+=1
+  elsif $on and /^\+/ =~ line and /^\-\-\-/ != line then $plus+=1
+  elsif $on and /^\-/ =~ line and /^\+\+\+/ != line then $minus+=1
   end
 }
 
@@ -35,5 +35,5 @@
 $file="total"
 $plus=$plustot
 $minus=$minustot
-puts "-"*64
+puts "-"*72
 show



More information about the Gridflow-cvs mailing list