From 2ca8686f9c47f45bcbbd62fe6a8f19952f9dfab4 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 22 Jan 2008 23:12:49 +0000 Subject: [PATCH] Display amount of affected lines as comment. --- find-changes-by-mia | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/find-changes-by-mia b/find-changes-by-mia index 8f7c00c..f118a56 100755 --- a/find-changes-by-mia +++ b/find-changes-by-mia @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -file, rev, author, state = nil, nil, nil, :F +file, rev, author, lines, state = nil, nil, nil, nil, :F mia_authors = ARGV IO.popen('cvs log') do |io| io.each_line do |line| @@ -8,20 +8,24 @@ IO.popen('cvs log') do |io| case line when /\A-+\z/ state = :R - if rev && author && mia_authors.include?(author) + if rev && author && File.basename(file) != 'ChangeLog' && + mia_authors.include?(author) prev_rev = rev.sub(/\d+\z/) {|s| (s.to_i - 1).to_s} - puts("cvs diff -u -r #{prev_rev} -r #{rev} #{File.basename(file)}") + puts("cvs diff -u -r #{prev_rev} -r #{rev} #{File.basename(file)}\t# #{lines}") end - rev, author = nil, nil + rev, author, lines = nil, nil, nil when /\A=+\z/ state = :F - file, rev, author = nil, nil, nil + file, rev, author, lines = nil, nil, nil, nil when /\ARCS file:\s+(.+),v\z/ file = $1 if state == :F when /\Arevision\s+([0-9.]+)\z/ rev = $1 if state == :R - when /\Adate:\s+(?:.+?);\s+author:\s+(.+?);/ - author = $1 if state == :R + when /\Adate:\s+(?:.+?);\s+author:\s+(.+?);\s+state:\s+(?:.+?);\s+lines:\s+(.+)/ + if state == :R + author = $1 + lines = $2 + end end end end -- 1.7.10.4