nieuw formaat ook snappen
This commit is contained in:
parent
db30a683d8
commit
6a6d42f402
1 changed files with 48 additions and 14 deletions
|
|
@ -92,23 +92,57 @@ def svnparse(url)
|
||||||
body = fetch("#{url}/.svn/entries").body
|
body = fetch("#{url}/.svn/entries").body
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
|
if body.nil?
|
||||||
|
return
|
||||||
|
end
|
||||||
dirs = Array.new
|
dirs = Array.new
|
||||||
xmldoc = REXML::Document.new(body)
|
if body[0].chr == '<'
|
||||||
xmldoc.elements.each("wc-entries/entry") {|item|
|
xmldoc = REXML::Document.new(body)
|
||||||
case item.attribute("kind").to_s
|
xmldoc.elements.each("wc-entries/entry") {|item|
|
||||||
when "dir" then
|
case item.attribute("kind").to_s
|
||||||
if item.attribute("name").to_s == ""
|
when "dir" then
|
||||||
next
|
if item.attribute("name").to_s == ""
|
||||||
|
next
|
||||||
|
end
|
||||||
|
puts "#{item.attribute("name")}/"
|
||||||
|
dirs.push(item.attribute("name").to_s)
|
||||||
|
when "file" then
|
||||||
|
puts "#{item.attribute("name")} #{item.attribute("last-author")} #{item.attribute("committed-date")}"
|
||||||
|
else
|
||||||
|
puts " Strange kind #{item.attribute("kind")}"
|
||||||
end
|
end
|
||||||
puts "#{item.attribute("name")}/"
|
}
|
||||||
dirs.push(item.attribute("name").to_s)
|
else
|
||||||
when "file" then
|
lastline = ""
|
||||||
puts "#{item.attribute("name")} #{item.attribute("last-author")} #{item.attribute("committed-date")}"
|
commitdate = ""
|
||||||
else
|
author = ""
|
||||||
puts " Strange kind #{item.attribute("kind")}"
|
bodyarr = Array.new
|
||||||
end
|
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|
|
dirs.each{|dir|
|
||||||
|
#p "#{url}/#{dir}"
|
||||||
svnparse("#{url}/#{dir}")
|
svnparse("#{url}/#{dir}")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue