From: ueno Date: Tue, 22 Jan 2008 23:12:49 +0000 (+0000) Subject: Display amount of affected lines as comment. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ca8686f9c47f45bcbbd62fe6a8f19952f9dfab4;p=elisp%2Fepg.git Display amount of affected lines as comment. --- 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