From 6bcb17d78da2ed2df16c4d994c866dcf57ebe3f4 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Mon, 23 Nov 2009 13:25:07 +0100 Subject: own log class for history --- bzr.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bzr.rb') diff --git a/bzr.rb b/bzr.rb index 6c77717..973775e 100644 --- a/bzr.rb +++ b/bzr.rb @@ -17,10 +17,11 @@ # along with dudle. If not, see . # ############################################################################ -BZRCMD="export LC_ALL=de_DE.UTF-8; bzr" require "time" +require "log" class VCS + BZRCMD="export LC_ALL=de_DE.UTF-8; bzr" def VCS.init `#{BZRCMD} init` end @@ -39,12 +40,13 @@ class VCS def VCS.history log = `#{BZRCMD} log --forward`.split("-"*60) + ret = Log.new log.shift - log.collect{|s| - a = s.scan(/\nrevno:.*\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten - h = {"timestamp" => Time.parse(a[0]), - "commit message" => a[1]} + log.each{|s| + a = s.scan(/\nrevno:(.*)\ncommitter.*\n.*\ntimestamp: (.*)\nmessage:\n (.*)/).flatten + ret.add(a[0].to_i, Time.parse(a[1]), a[2]) } + ret end def VCS.longhistory dir -- cgit v1.2.3