]> git.pld-linux.org Git - packages/cvsspam.git/blame - cvsspam-cvsweb_loglink.patch
- issue xxx patch, rel 6
[packages/cvsspam.git] / cvsspam-cvsweb_loglink.patch
CommitLineData
abf71f33
ER
1Index: cvsspam.rb
2===================================================================
3--- cvsspam.rb (revision 229)
4+++ cvsspam.rb (working copy)
5@@ -671,6 +671,12 @@
6 def diff(file)
7 '->'
8 end
9+
10+ # may be overridden by subclasses that are able to make a hyperlink to a
11+ # history log for a file
12+ def log(file)
13+ ''
14+ end
15 end
16
17 # Superclass for objects that can link to CVS frontends on the web (ViewCVS,
18@@ -711,6 +717,14 @@
19 "<a href=\"#{diff_url(file)}\">#{super(file)}</a>"
20 end
21
22+ def log(file)
23+ link = log_url(file)
24+ if link
25+ return "<span id=\"info\">(<a href=\"#{link}\">log</a>)</span>"
26+ end
27+ return nil
28+ end
29+
30 protected
31 def add_repo(url)
32 if @repository_name
33@@ -723,6 +737,10 @@
34 url
35 end
36 end
37+
38+ def log_url(file)
39+ nil
40+ end
41 end
42
43 # Link to ViewCVS
44@@ -781,6 +799,17 @@
45 def diff_url(file)
46 add_repo("#{@base_url}#{urlEncode(file.path)}.diff?r1=text&amp;tr1=#{file.fromVer}&amp;r2=text&amp;tr2=#{file.toVer}&amp;f=h")
47 end
48+
49+ protected
50+
51+ def log_url(file)
52+ if file.toVer
53+ log_anchor = "#rev#{file.toVer}"
54+ else
55+ log_anchor = ""
56+ end
57+ add_repo("#{@base_url}#{urlEncode(file.path)}#{log_anchor}")
58+ end
59 end
60
61
62@@ -1547,11 +1576,14 @@
63 elsif file.removal?
64 name = "<span id=\"removed\">#{name}</span>"
65 end
66+ mail.print("<td>")
67 if file.has_diff?
68- mail.print("<td><tt>#{prefix}<a href=\"#file#{file_count}\">#{name}</a></tt></td>")
69+ mail.print("<tt>#{prefix}<a href=\"#file#{file_count}\">#{name}</a></tt>")
70 else
71- mail.print("<td><tt>#{prefix}#{name}</tt></td>")
72+ mail.print("<tt>#{prefix}#{name}</tt>")
73 end
74+ mail.print(" #{$frontend.log(file)}")
75+ mail.print("</td>")
76 if file.isEmpty
77 mail.print("<td colspan=\"2\" align=\"center\"><small id=\"info\">[empty]</small></td>")
78 elsif file.isBinary
This page took 0.072754 seconds and 4 git commands to generate.