From 5a6bee4fe076e06514c6e4e538590dd3a2a5cdc3 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Fri, 6 Nov 2009 18:37:00 +0000 Subject: upgrade gridflow svn path=/trunk/; revision=12728 --- externals/gridflow/bin/plusminus | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 externals/gridflow/bin/plusminus (limited to 'externals/gridflow/bin/plusminus') diff --git a/externals/gridflow/bin/plusminus b/externals/gridflow/bin/plusminus new file mode 100755 index 00000000..36f268f5 --- /dev/null +++ b/externals/gridflow/bin/plusminus @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby +# NOTE: this works with svn diff -u only!!! + +puts "-"*72 + +$plustot=0 +$minustot=0 + +def show + printf "%40s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus +end + +loop{ + line = gets + break if not line + if /^\+\+\+/.match line then + x = line.split(/\s+/) + $plustot+=$plus if $plus + $minustot+=$minus if $minus + show if $file + $file = x[1] + $on=false + $plus=0 + $minus=0 + elsif /^\@\@/ =~ line then $on=true + elsif $on and /^\+/ =~ line and /^\-\-\-/ != line then $plus+=1 + elsif $on and /^\-/ =~ line and /^\+\+\+/ != line then $minus+=1 + end +} + +$plustot+=$plus if $plus +$minustot+=$minus if $minus +show if $file + +$file="total" +$plus=$plustot +$minus=$minustot +puts "-"*72 +show -- cgit v1.2.1