SVN filter script
September 16th, 2009 by HenThere’s probably a better way, but thought I’d share a quick hacked up script I created to take an SVN changelog and filter out revisions that I didn’t want there. I used it while merging Commons Collections generics branch into trunk to create specific submit messages showing the bugs fixed on each file in its commit message. I filtered out the common and not interesting revisions for fixing tabs, or my shifting of the license header so the merging went easier.
# ARGV contains a list of filters to ignore
# stdin contains a file
svn_separator = "------------------------------------------------------------------------n";
entries = $stdin.read.split(svn_separator);
ARGV.each do |revision|
match = "^r#{revision}"
entries = entries.select do |entry|
entry !~ /#{revision}/
end
end
if(entries.length > 1) then
puts entries.join(svn_separator);
puts svn_separator
end
