/[cvs]/jonen/ruby/CVSspam/cvsspam.rb
ViewVC logotype

Diff of /jonen/ruby/CVSspam/cvsspam.rb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by jonen, Sat Jan 18 23:58:36 2003 UTC revision 1.6 by jonen, Sun Jan 19 01:03:31 2003 UTC
# Line 727  $handlers["M"].setTagHandler(tagHandler) Line 727  $handlers["M"].setTagHandler(tagHandler)
727    
728  $fileEntries = Array.new  $fileEntries = Array.new
729  $todoList = Array.new  $todoList = Array.new
730    all_files = ""
731    
732  File.open("#{$logfile}.emailtmp", File::RDWR|File::CREAT|File::TRUNC) do |mail|  File.open("#{$logfile}.emailtmp", File::RDWR|File::CREAT|File::TRUNC) do |mail|
733    
# Line 746  end Line 747  end
747  if $subjectPrefix == nil  if $subjectPrefix == nil
748    $subjectPrefix = "[CVS #{Repository.array.join(',')}]"    $subjectPrefix = "[CVS #{Repository.array.join(',')}]"
749  end  end
750    $fileEntries.each do |file|  # HACK: put all file names at mail subject
751      unless file.repository == $subjectPrefix  $fileEntries.each do |file|
752        last_repository = file.repository    name = htmlEncode(file.name_after_common_prefix)
753        file = #{htmlEncode(last_repository.common_prefix)}    if all_files == nil
754        all_files = all_files + " " + file      all_files = name
755      end    else
756        all_files = all_files + ";" + name
757    end    end
758  mailSubject = all_files  end
759  mailSubject = "#{$subjectPrefix} #{$mailSubject}"  
760    mailSubject = "#{$subjectPrefix} #{all_files} #{$mailSubject}"
761  if mailSubject.length > $maxSubjectLength  if mailSubject.length > $maxSubjectLength
762    mailSubject = mailSubject[0, $maxSubjectLength]    mailSubject = mailSubject[0, $maxSubjectLength]
763  end  end
# Line 854  HEAD Line 857  HEAD
857        end        end
858        lastPath = thisPath        lastPath = thisPath
859      end      end
860        if all_files == nil
861          all_files = name
862        else
863          all_files = all_files + " " + name
864        end
865      if file.addition?      if file.addition?
866        name = "<span id=\"added\">#{name}</span>"        name = "<span id=\"added\">#{name}</span>"
867      elsif file.removal?      elsif file.removal?
# Line 895  HEAD Line 903  HEAD
903        mail.print("<td align=\"center\">#{viewcvsFile(file.path,file.fromVer)} #{viewcvsDiff(file)} #{viewcvsFile(file.path,file.toVer)}</td>")        mail.print("<td align=\"center\">#{viewcvsFile(file.path,file.fromVer)} #{viewcvsDiff(file)} #{viewcvsFile(file.path,file.toVer)}</td>")
904      end      end
905    
906      mail.puts("</tr>")      mail.puts("</tr>")    
907    end    end
908      
909    if $fileEntries.size>1    if $fileEntries.size>1
910      # give total number of lines added/removed accross all files      # give total number of lines added/removed accross all files
911      mail.print("<tr><td>&nbsp;</td>")      mail.print("<tr><td>&nbsp;</td>")

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed