SOURCES: cvsspam-cvsweb_loglink.patch (NEW) - saved from mailing list
glen
glen at pld-linux.org
Thu Nov 17 18:37:12 CET 2005
Author: glen Date: Thu Nov 17 17:37:12 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- saved from mailing list
---- Files affected:
SOURCES:
cvsspam-cvsweb_loglink.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/cvsspam-cvsweb_loglink.patch
diff -u /dev/null SOURCES/cvsspam-cvsweb_loglink.patch:1.1
--- /dev/null Thu Nov 17 18:37:12 2005
+++ SOURCES/cvsspam-cvsweb_loglink.patch Thu Nov 17 18:37:07 2005
@@ -0,0 +1,78 @@
+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 @@
+ "<a href=\"#{diff_url(file)}\">#{super(file)}</a>"
+ end
+
++ def log(file)
++ link = log_url(file)
++ if link
++ return "<span id=\"info\">(<a href=\"#{link}\">log</a>)</span>"
++ 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 = "<span id=\"removed\">#{name}</span>"
+ end
++ mail.print("<td>")
+ if file.has_diff?
+- mail.print("<td><tt>#{prefix}<a href=\"#file#{file_count}\">#{name}</a></tt></td>")
++ mail.print("<tt>#{prefix}<a href=\"#file#{file_count}\">#{name}</a></tt>")
+ else
+- mail.print("<td><tt>#{prefix}#{name}</tt></td>")
++ mail.print("<tt>#{prefix}#{name}</tt>")
+ end
++ mail.print(" #{$frontend.log(file)}")
++ mail.print("</td>")
+ if file.isEmpty
+ mail.print("<td colspan=\"2\" align=\"center\"><small id=\"info\">[empty]</small></td>")
+ elsif file.isBinary
================================================================
More information about the pld-cvs-commit
mailing list