commit 07f38760615117fd7a0070b1864fdd4d99856ef2 Author: Simon Howard Date: Sun Feb 26 14:23:43 2006 +0000 Add maintenance tools Subversion-branch: /tools Subversion-revision: 393 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bbee65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ + +# These are the default patterns globally ignored by Subversion: +*.o +*.lo +*.la +*.al +.libs +*.so +*.so.[0-9]* +*.a +*.pyc +*.pyo +*.rej +*~ +.#* +.*.swp +.DS_store diff --git a/svnhistory b/svnhistory new file mode 100755 index 0000000..dd0bdc8 --- /dev/null +++ b/svnhistory @@ -0,0 +1,53 @@ +#!/usr/bin/env ruby + +class Change + attr_accessor :author, :time, :description + + def initialize + @description = "" + end + + def print_change + puts "#{@time} #{@author}" + @description.each_line do |s| + puts "\t" + s + end + end +end + +changes = [] + +IO.popen("svn log .") do |io| + + current_change = nil + + io.each_line do |s| + + s = s.chomp + + if s =~ /^-+$/ + # start of a new change + + if current_change != nil + changes.push(current_change) + end + current_change = Change.new + elsif current_change.author == nil + # first line of new change + + fields = s.split(/ \| /) + current_change.author = fields[1] + + # time + timebits = fields[2].split(/\s+/) + current_change.time = timebits[0] + " " + timebits[1] + else + current_change.description += s + "\n" + end + end +end + +changes.each do |change| + change.print_change +end +