--- jonen/ruby/CVSspam/cvsspam.rb 2003/01/18 23:45:56 1.1 +++ jonen/ruby/CVSspam/cvsspam.rb 2003/01/19 01:10:28 1.9 @@ -3,6 +3,8 @@ # collect_diffs.rb expects to find this script in the same directory as it # + + # TODO: exemplify syntax for 'cvs admin -m' when log message is missing # TODO: make max-line limit on diff output configurable # TODO: put max size limit on whole email @@ -725,6 +727,7 @@ $fileEntries = Array.new $todoList = Array.new +all_files = "" File.open("#{$logfile}.emailtmp", File::RDWR|File::CREAT|File::TRUNC) do |mail| @@ -744,14 +747,17 @@ if $subjectPrefix == nil $subjectPrefix = "[CVS #{Repository.array.join(',')}]" end - $fileEntries.each do |file| - unless file.repository == last_repository - last_repository = file.repository - file = #{htmlEncode(last_repository.common_prefix)} - all_files = all_files + " " + file - end +# HACK: put all file names at mail subject +$fileEntries.each do |file| + name = htmlEncode(file.name_after_common_prefix) + if all_files == "" + all_files = name + else + all_files = all_files + ";" + name end -mailSubject = "#{$subjectPrefix} file #{$mailSubject}" +end + +mailSubject = "#{$subjectPrefix} #{all_files} #{$mailSubject}" if mailSubject.length > $maxSubjectLength mailSubject = mailSubject[0, $maxSubjectLength] end @@ -851,6 +857,11 @@ end lastPath = thisPath end + if all_files == nil + all_files = name + else + all_files = all_files + " " + name + end if file.addition? name = "#{name}" elsif file.removal? @@ -892,8 +903,9 @@ mail.print("#{viewcvsFile(file.path,file.fromVer)} #{viewcvsDiff(file)} #{viewcvsFile(file.path,file.toVer)}") end - mail.puts("") + mail.puts("") end + if $fileEntries.size>1 # give total number of lines added/removed accross all files mail.print(" ") @@ -961,3 +973,4 @@ mail.puts("") end +