changeset 239:99be67db8a12

Add the rules revision number to the filenames used by the web status reports.
author Bernhard Herzog <bh@intevation.de>
date Wed, 14 Jan 2009 16:33:47 +0000
parents 169f0373fbd5
children 58cf7e6b7cca
files treepkg/web.py web/status-by-startdate.html
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/web.py	Tue Jan 13 17:20:25 2009 +0000
+++ b/treepkg/web.py	Wed Jan 14 16:33:47 2009 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
 #
@@ -7,6 +7,7 @@
 
 import os
 import shutil
+import re
 
 from genshi.template import TemplateLoader
 
@@ -35,13 +36,16 @@
         stream = tmpl.generate(report=report.prepare_report(group))
         return stream.render('html')
 
-    def determine_log_filename(self, package_track_name, revno, log_basename):
+    def determine_log_filename(self, package_track_name, revdir, log_basename):
         """Returns the name of a log file of a revision if it exists"""
+        if re.match("(?P<revno>[0-9]+)-(?P<rulesrev>[0-9]+)$", revdir):
+            revno, rulesrev = map(int, revdir.split("-"))
         group = report.get_packager_group(self.treepkg_config)
         for track in group.get_package_tracks():
             if track.name == package_track_name:
                 for revision in track.get_revisions():
-                    if str(revision.revision) == revno:
+                    if (revision.revision == revno
+                        and revision.rules_revision == rulesrev):
                         for title, filename in revision.list_log_files():
                             if os.path.basename(filename) == log_basename:
                                 return filename
@@ -77,7 +81,9 @@
         for track in group.get_package_tracks():
             trackdir = os.path.join(destdir, track.name)
             for revision in track.get_revisions():
-                revdir = os.path.join(trackdir, str(revision.revision))
+                revdir = os.path.join(trackdir,
+                                      "%d-%d" % (revision.revision,
+                                                 revision.rules_revision))
                 if revision.has_build_log():
                     if not os.path.isdir(trackdir):
                         os.mkdir(trackdir)
--- a/web/status-by-startdate.html	Tue Jan 13 17:20:25 2009 +0000
+++ b/web/status-by-startdate.html	Wed Jan 14 16:33:47 2009 +0000
@@ -43,7 +43,7 @@
 	    <td>${item.status.stop}</td>
 	    <td>
 	      <py:for each="title, basename in item.log_files">
-		<a href="${item.name}/${item.revno}/${basename}">${title}</a>
+		<a href="${item.name}/${item.revno}-${item.rulesrev}/${basename}">${title}</a>
 	      </py:for>
 	    </td>
 	  </tr>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)