mirror of
https://github.com/chocolate-doom/tools.git
synced 2024-11-23 21:02:05 +00:00
Add maintenance tools
Subversion-branch: /tools Subversion-revision: 393
This commit is contained in:
commit
07f3876061
2 changed files with 70 additions and 0 deletions
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
|
@ -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
|
53
svnhistory
Executable file
53
svnhistory
Executable file
|
@ -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
|
||||
|
Loading…
Reference in a new issue