nieuw formaat ook snappen
This commit is contained in:
parent
db30a683d8
commit
6a6d42f402
1 changed files with 48 additions and 14 deletions
|
|
@ -92,7 +92,11 @@ def svnparse(url)
|
|||
body = fetch("#{url}/.svn/entries").body
|
||||
rescue
|
||||
end
|
||||
if body.nil?
|
||||
return
|
||||
end
|
||||
dirs = Array.new
|
||||
if body[0].chr == '<'
|
||||
xmldoc = REXML::Document.new(body)
|
||||
xmldoc.elements.each("wc-entries/entry") {|item|
|
||||
case item.attribute("kind").to_s
|
||||
|
|
@ -108,7 +112,37 @@ def svnparse(url)
|
|||
puts " Strange kind #{item.attribute("kind")}"
|
||||
end
|
||||
}
|
||||
else
|
||||
lastline = ""
|
||||
commitdate = ""
|
||||
author = ""
|
||||
bodyarr = Array.new
|
||||
body.each_line{|line|
|
||||
bodyarr.push line
|
||||
}
|
||||
(0...bodyarr.length).each{|count|
|
||||
line = bodyarr[count]
|
||||
line.chomp!
|
||||
if line.match(/\d\d\d\d-\d\d-\d\dT/)
|
||||
commitdate = line
|
||||
author = bodyarr[count+2]
|
||||
end
|
||||
case line
|
||||
when 'dir'
|
||||
if lastline == ""
|
||||
next
|
||||
end
|
||||
puts "#{lastline}/"
|
||||
dirs.push lastline
|
||||
when 'file'
|
||||
puts "#{lastline} #{author} #{commitdate}"
|
||||
else
|
||||
lastline = line
|
||||
end
|
||||
}
|
||||
end
|
||||
dirs.each{|dir|
|
||||
#p "#{url}/#{dir}"
|
||||
svnparse("#{url}/#{dir}")
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue