New file.
authorueno <ueno>
Tue, 22 Jan 2008 22:38:07 +0000 (22:38 +0000)
committerueno <ueno>
Tue, 22 Jan 2008 22:38:07 +0000 (22:38 +0000)
find-changes-by-mia [new file with mode: 0755]

diff --git a/find-changes-by-mia b/find-changes-by-mia
new file mode 100755 (executable)
index 0000000..5a32f1b
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env ruby
+
+file, rev, author, state = nil, nil, nil, :F
+mia_committers = ARGV
+IO.popen('cvs log') do |io|
+  io.each_line do |line|
+    line.chomp!
+    case line
+    when /\A-+\z/
+      state = :R
+      if rev && author && mia_committers.include?(author)
+        prev_rev = rev.sub(/\d+\z/) {|s| (s.to_i - 1).to_s}
+        puts("cvs diff -r #{prev_rev} -r #{rev} #{File.basename(file)}")
+      end
+      rev, author = nil, nil
+    when /\A=+\z/
+      state = :F
+      file, rev, author = 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
+    end
+  end
+end