changeset 146:1766e2ee9457

new report type: sorted by start date instead of revision number. This is more useful usually, especially if different tracks come from different SVN repositories.
author Bernhard Herzog <bh@intevation.de>
date Thu, 05 Jun 2008 11:05:55 +0000
parents 123e9a5f31fa
children cfeb0251055b
files treepkg/report.py
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/report.py	Thu Jun 05 10:36:10 2008 +0000
+++ b/treepkg/report.py	Thu Jun 05 11:05:55 2008 +0000
@@ -93,6 +93,31 @@
         revisions.reverse()
         return revisions
 
+    def sorted_by_startdate(self):
+        revisions = []
+        for column, track in enumerate(self.tracks):
+            for revision in track.get_revisions():
+                revisions.append((revision.status.start,
+                                  struct(revno=revision.revision,
+                                         revision=revision,
+                                         log_files =
+                                           [(title, os.path.basename(filename))
+                                            for title, filename
+                                            in revision.list_log_files()],
+                                         column=column,
+                                         name=track.name,
+                                         new_date = None,
+                                      status=prepare_status(revision.status))))
+        revisions.sort()
+        revisions.reverse()
+
+        last_date = None
+        for start, rev in revisions:
+            if last_date != start.date():
+                last_date = start.date()
+                rev.new_date = str(last_date)
+        return revisions
+
 def prepare_report(group):
     return struct(revisions=Revisions(group.get_package_tracks()),
                   date=format_time(datetime.datetime.utcnow()))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)