From 50fcdea9977a29ad690cbb444b990b2d8c1092ae Mon Sep 17 00:00:00 2001 From: randomdan Date: Sun, 14 Nov 2010 03:29:47 +0000 Subject: Populate and use new change logs table --- gentoobrowse/console/packageimport.xml | 40 ++++++++++++++++++++++++++++++++++ gentoobrowse/package.xslt | 17 +++++++++------ gentoobrowse/views/package.xml | 13 +++++------ 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/gentoobrowse/console/packageimport.xml b/gentoobrowse/console/packageimport.xml index 95743a4..fbfb25b 100644 --- a/gentoobrowse/console/packageimport.xml +++ b/gentoobrowse/console/packageimport.xml @@ -169,5 +169,45 @@ + + + SELECT packageid, + CAST(r[1] AS DATE) AS DATE, + RANK() OVER(PARTITION BY packageid, CAST(r[1] AS DATE) ORDER BY s.linebegin) AS n, + r[2] AS person, + r[3] AS email, + (SELECT TRIM(SPLIT_PART(STRING_AGG(m.content, ' ' ORDER BY m.line), ':', 2)) + FROM filecache m + WHERE m.fileid=s.fileid + AND m.line >= s.linebegin + AND m.content not like '*%' + AND (m.line < s.lineend OR s.lineend IS NULL)) AS comment + FROM (SELECT f.fileid, + p.packageid, + fc.line AS linebegin, + REGEXP_MATCHES(content, '([0-9]{2} [[:alnum:]]+ [0-9]{2,4}); ?(.+)? <([^ >]+)') AS r, + (SELECT MIN(line) + FROM filecache nl + WHERE nl.fileid = f.fileid + AND nl.content ~ '([0-9]{2} [[:alnum:]]+ [0-9]{2,4}); ?(.+)? <([^ >]+)' + AND nl.line > fc.line) AS lineend + FROM filecache fc, files f, packages p, categories c + WHERE f.fileid=fc.fileid + AND f.filetypeid = 2 + AND c.categoryid = p.categoryid + AND p.name = SPLIT_PART(f.filename, '/', 2) + AND c.name = SPLIT_PART(f.filename, '/', 1)) AS s + WHERE IS_DATE(s.r[1]) + + + packageid + date + n + person + email + comment + + + diff --git a/gentoobrowse/package.xslt b/gentoobrowse/package.xslt index 5f0852d..37bf811 100644 --- a/gentoobrowse/package.xslt +++ b/gentoobrowse/package.xslt @@ -121,7 +121,7 @@

Masks

- +

Change log

@@ -173,13 +173,16 @@ - -
-		  
-		  	
-
+  	
+		
    + +
  • +
      +
    • <>
    • +
    • +
    -
+
diff --git a/gentoobrowse/views/package.xml b/gentoobrowse/views/package.xml index d526df4..cbf9dfc 100644 --- a/gentoobrowse/views/package.xml +++ b/gentoobrowse/views/package.xml @@ -157,15 +157,12 @@ - + - SELECT line, content - FROM files f, filecache fc, packages p, categories c - WHERE f.fileid = fc.fileid - AND p.categoryid = c.categoryid - AND f.filename = c.name || '/' || p.name || '/ChangeLog' - AND p.packageid = ? - ORDER BY line + SELECT date, person, email, comment + FROM package_changelogs + WHERE packageid = ? + ORDER BY date DESC, n DESC -- cgit v1.2.3