Skip to content

Commit

Permalink
Changed how changesets work, changed DEBUG stuff, other stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins committed Feb 28, 2012
1 parent 178e789 commit 6368904
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions lib/kriek.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def initialize
def menu
m = ""
m << "Kriek. KITT: #{@kitt || '<undefined>'}; Release Number: #{@release_number || '<undefined>'}\n"
m << "SET DEBUG ON|OFF Set debug mode on or off\n"
m << "SET KITT <kitt> Set the KITT number for releasing this cherry-pick\n"
m << "SET REL <rel> Set the release number for this cherry-pick\n"
m << "Add Range <from>:<to> Merge a range of svn revisions (currently I have: #{rowize(@ranges, 96, 80, 57)})\n"
Expand Down Expand Up @@ -304,16 +305,16 @@ def svn_log(opts = "")
range =~ /(\d+):(\d+)/
r1 = $1.to_i
r2 = $2.to_i
print "(" if @debug
(r1..r2).each do |rev|
print "#{rev} " if @debug
stdout = svn_backticks "log -r #{rev} #{opts} #{SVN_URL}"
#print "(" if @debug
#(r1..r2).each do |rev|
# print "#{rev} " if @debug
stdout = svn_backticks "log -r #{range} #{opts} #{SVN_URL}"
if stdout
s << stdout
else
s << "KRIEK ERROR: svn log failed 5 times. So sorry."
end
end
#end
puts ")" if @debug
end

Expand Down Expand Up @@ -396,24 +397,46 @@ def jiras_rev(c)
def liquibase_changesets
l = []
log = svn_log("-v")
this_revision = nil
this_build = nil
log.split(/\n/).each do |line|
if ( line =~ /^ \w (.*kfs-cfg-dbs\/trunk\/update\/(.+)\.xml)$/ or
line =~ /^ \w (.*kfs-cfg-dbs\/trunk\/latest\/\w+\/(.+)\.xml)$/
if ( line =~ /^r(\d+)/ )
this_revision = "r#{$1}"
end

if ( line =~ /^Auto: releasing .* 3.0-(\d+)/ )
this_build = "3.0-#{$1}"
end

if ( line =~ /^ D (.*kfs-cfg-dbs\/trunk\/update\/(.+)\.xml)$/ or
line =~ /^ D (.*kfs-cfg-dbs\/trunk\/latest\/\w+\/(.+)\.xml)$/
)
changeset = $1
file_name = $2
l.each_with_index do |ch, i|
if ch[file_name]
l[i] << " (included in #{this_build})"
end
end
end

if ( line =~ /^ A (.*kfs-cfg-dbs\/trunk\/update\/(.+)\.xml)$/ or
line =~ /^ A (.*kfs-cfg-dbs\/trunk\/latest\/\w+\/(.+)\.xml)$/
)
changeset = $1
file_name = $2
if file_name =~ /^KITT-\d{4}$/
l << changeset
l << "#{this_revision} #{changeset}"
else
comment = "(but #{file_name}.xml isn't named like KITT-XXXX.xml)"
len = 79-comment.length
l << "#{changeset}\n#{" "*len} #{comment}"
end
end
end
l
l.uniq
end

def workflow_changes
w = {}
current_revision = ""
Expand All @@ -422,8 +445,8 @@ def workflow_changes
if line =~ /^r(\d+) \|/
current_revision = $1.to_s
end
if line =~ /^ \w (.*workflow.*\.xml)$/

if line =~ /^ \w (.*trunk.*workflow.*\.xml)$/
w[current_revision] ||= []
w[current_revision] << $1
end
Expand Down

0 comments on commit 6368904

Please sign in to comment.