Index: cvsspam.rb =================================================================== --- cvsspam.rb (revision 229) +++ cvsspam.rb (working copy) @@ -671,6 +671,12 @@ def diff(file) '->' end + + # may be overridden by subclasses that are able to make a hyperlink to a + # history log for a file + def log(file) + '' + end end # Superclass for objects that can link to CVS frontends on the web (ViewCVS, @@ -711,6 +717,14 @@ "#{super(file)}" end + def log(file) + link = log_url(file) + if link + return "(log)" + end + return nil + end + protected def add_repo(url) if @repository_name @@ -723,6 +737,10 @@ url end end + + def log_url(file) + nil + end end # Link to ViewCVS @@ -781,6 +799,17 @@ def diff_url(file) add_repo("#{@base_url}#{urlEncode(file.path)}.diff?r1=text&tr1=#{file.fromVer}&r2=text&tr2=#{file.toVer}&f=h") end + + protected + + def log_url(file) + if file.toVer + log_anchor = "#rev#{file.toVer}" + else + log_anchor = "" + end + add_repo("#{@base_url}#{urlEncode(file.path)}#{log_anchor}") + end end @@ -1547,11 +1576,14 @@ elsif file.removal? name = "#{name}" end + mail.print("") if file.has_diff? - mail.print("#{prefix}#{name}") + mail.print("#{prefix}#{name}") else - mail.print("#{prefix}#{name}") + mail.print("#{prefix}#{name}") end + mail.print(" #{$frontend.log(file)}") + mail.print("") if file.isEmpty mail.print("[empty]") elsif file.isBinary