diff bin/listpackages.py @ 251:243f206574cb

Make bin/listpackages.py prefer the newest packages by start-time, not revision number. Change test_listpackages.py so that it uses more realistic status files for the individual revisions and adapt the test cases to the new behavior.
author Bernhard Herzog <bh@intevation.de>
date Thu, 09 Apr 2009 18:59:44 +0000
parents 5dd710b167d2
children 2e0b373414b8
line wrap: on
line diff
--- a/bin/listpackages.py	Thu Apr 09 18:20:04 2009 +0000
+++ b/bin/listpackages.py	Thu Apr 09 18:59:44 2009 +0000
@@ -62,12 +62,14 @@
     if not revisions and main_rev is None:
         return
 
+    revisions = sorted(revisions, key=lambda r: r.status.start, reverse=True)
+
     if main_rev is None:
-        revpkg = revisions[-1]
+        revpkg = revisions[0]
     else:
         # iterate in reverse, so that we pick up the newest revision
         # packager with the desired revision first if rules_rev is None
-        for revpkg in revisions[::-1]:
+        for revpkg in revisions:
             if revpkg.revision == main_rev:
                 if rules_rev is None or revpkg.rules_revision == rules_rev:
                     break
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)