From 07f38760615117fd7a0070b1864fdd4d99856ef2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 26 Feb 2006 14:23:43 +0000 Subject: [PATCH] Add maintenance tools Subversion-branch: /tools Subversion-revision: 393 --- .gitignore | 17 +++++++++++++++++ svnhistory | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .gitignore create mode 100755 svnhistory 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 +