Bug#695543: bugs.cgi: also show removal requests
Control: retitle -1 bugs.cgi: show unblock and removal requests based on usertags
Hi,
On Mon, Dec 10, 2012 at 12:28:02AM +0100, Ivo De Decker wrote:
> In bugs.cgi the unblock requests are shown based on bugs against
> release.debian.org that match '^unblock (package)'. A number of unblock
> requests have a (slightly) different title. They all (should) have an unblock
> usertag, so the unblock requests can be found based on that usertag. That way,
> more unblock can be found and displayed.
The attached patch (on top of the previous one) also show removal requests
(from testing and unstable).
Cheers,
Ivo
diff --git a/web/bugs.cgi b/web/bugs.cgi
index ba0fa76..4c2a2ea 100755
--- a/web/bugs.cgi
+++ b/web/bugs.cgi
@@ -358,10 +358,11 @@ if cols['chints']
hints[r['source']] ||= []
hints[r['source']] << r
end
- sthh = dbh.prepare("select distinct bugs_usertags.id as id, bugs_usertags.tag as tag, bugs.title as title from bugs_usertags, bugs where bugs.id = bugs_usertags.id and bugs_usertags.email='release.debian.org@packages.debian.org' and bugs_usertags.tag='unblock' and bugs.status = 'pending'")
+ sthh = dbh.prepare("select distinct bugs_usertags.id as id, bugs_usertags.tag as tag, bugs.title as title from bugs_usertags, bugs where bugs.id = bugs_usertags.id and bugs_usertags.email in ('release.debian.org@packages.debian.org','ftp.debian.org@packages.debian.org') and bugs_usertags.tag in ('unblock','rm','remove') and bugs.status = 'pending'")
sthh.execute
rowsh = sthh.fetch_all
unblockreq = {}
+ unblockreqtype = {}
ids = []
rowsh.each do |r|
src = (/[^-a-zA-Z0-9.]([-a-zA-Z0-9.]+)\//.match(r['title']) || [] ) [1] || "";
@@ -370,6 +371,7 @@ if cols['chints']
end
unblockreq[src] ||= []
unblockreq[src] << r['id']
+ unblockreqtype[r['id']] = r['tag']
ids << r['id']
end
ids = ids.join(',')
@@ -446,7 +448,7 @@ puts '<th>last modified</th></tr>'
puts '</thead>'
puts '<tbody>'
-def genhints(source, hints, unblockreq, tags)
+def genhints(source, hints, unblockreq, tags, type)
s = ''
if not hints.nil?
hints.each do |h|
@@ -457,7 +459,12 @@ def genhints(source, hints, unblockreq, tags)
end
if not unblockreq.nil?
unblockreq.each do |u|
- s += "req:<a href=\"http://bugs.debian.org/#{u}\">##{u}</a>#{gentags(tags[u])} "
+ if (type[u] != "unblock")
+ s += " #{type[u]}";
+ else
+ s += "req"
+ end
+ s += ":<a href=\"http://bugs.debian.org/#{u}\">##{u}</a>#{gentags(tags[u])} "
end
end
s
@@ -530,7 +537,7 @@ rows.each do |r|
puts "<td>#{CGI::escapeHTML(r['title'])}</td>"
puts "<td>#{r['popcon']}</td>" if cols['cpopcon']
puts "<td>#{r['severity']}</td>" if cols['cseverity']
- puts "<td>#{genhints(r['source'], hints[r['source']], unblockreq[r['source']], unblockreqtags)}</td>" if cols['chints']
+ puts "<td>#{genhints(r['source'], hints[r['source']], unblockreq[r['source']], unblockreqtags, unblockreqtype)}</td>" if cols['chints']
puts "<td>#{claimedbugs[r['id']]}</td>" if cols['cclaimed']
puts "<td>#{deferredbugs[r['id']]}</td>" if cols['cdeferred']
puts "<td>#{rttags[r['id']]}</td>" if cols['crttags']
Reply to: