#!/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|
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