aboutsummaryrefslogtreecommitdiff
path: root/bzr.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-23 13:25:07 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-23 13:25:07 +0100
commit6bcb17d78da2ed2df16c4d994c866dcf57ebe3f4 (patch)
tree2039349e5df09c308b81ce1b0fd142491799209c /bzr.rb
parent587e9f38c972217f15a8fc09eba0c9180da8d147 (diff)
own log class for history
Diffstat (limited to '')
-rw-r--r--bzr.rb12
1 files changed, 7 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>. #
############################################################################
-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