Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11569: correct_commit_message.diff

File correct_commit_message.diff, 2.3 kB (added by mainej, 6 months ago)
  • lib/continuous_builder.rb

    old new  
    9292      @status =~ /[A-Z]\s+[\w\/]+/ 
    9393    end 
    9494 
    95     def current_revision 
    96       info['Revision'].to_i 
     95    def last_revision 
     96      info['Last Changed Rev'].to_i 
    9797    end 
    9898  
    9999    def url 
     
    101101    end 
    102102  
    103103    def last_commit_message 
    104       execute("svn log", " -rHEAD -v") 
     104      execute("svn log", " -r#{current_revision} -v") 
    105105    end 
    106106  
    107107    def last_author 
     
    135135 
    136136  class MailNotifier < ActionMailer::Base 
    137137    def failure(build, options, sent_at = Time.now) 
    138       @subject = "[#{options[:application_name]}] Build broken by #{build.checkout.last_author} (##{build.checkout.current_revision})" 
     138      @subject = "[#{options[:application_name]}] Build broken by #{build.checkout.last_author} (##{build.checkout.last_revision})" 
    139139      @body    = [ build.checkout.last_commit_message, build.output ].join("\n\n") 
    140140 
    141141      @recipients, @from, @sent_on = options[:recipients], options[:sender], sent_at 
    142142    end 
    143143     
    144144    def broken(build, options, sent_at = Time.now) 
    145       @subject = "[#{options[:application_name]}] Build still broken (##{build.checkout.current_revision})" 
     145      @subject = "[#{options[:application_name]}] Build still broken (##{build.checkout.last_revision})" 
    146146      @body    = [ build.checkout.last_commit_message, build.output ].join("\n\n") 
    147147 
    148148      @recipients, @from, @sent_on = options[:recipients], options[:sender], sent_at 
    149149    end 
    150150     
    151151    def revival(build, options, sent_at = Time.now) 
    152       @subject = "[#{options[:application_name]}] Build fixed by #{build.checkout.last_author} (##{build.checkout.current_revision})" 
     152      @subject = "[#{options[:application_name]}] Build fixed by #{build.checkout.last_author} (##{build.checkout.last_revision})" 
    153153      @body    = [ build.checkout.last_commit_message ].join("\n\n") 
    154154 
    155155      @recipients, @from, @sent_on = options[:recipients], options[:sender], sent_at 
     
    177177      end 
    178178     
    179179      def changeset(options, build) 
    180         options[:changeset_url] + build.checkout.current_revision.to_s 
     180        options[:changeset_url] + build.checkout.last_revision.to_s 
    181181      end 
    182182     
    183183      def deliver(to, subject, output = nil)