[Treepkg-commits] r180 - trunk/bin

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 14 15:15:42 CEST 2009


Author: bh
Date: 2009-04-14 15:15:41 +0200 (Tue, 14 Apr 2009)
New Revision: 180

Modified:
   trunk/bin/listpackages.py
Log:
Correct the help string for listpackages' --newest option and set a
better default for it.


Modified: trunk/bin/listpackages.py
===================================================================
--- trunk/bin/listpackages.py	2009-04-14 12:45:12 UTC (rev 179)
+++ trunk/bin/listpackages.py	2009-04-14 13:15:41 UTC (rev 180)
@@ -16,7 +16,7 @@
 
 def parse_commandline():
     parser = create_parser()
-    parser.set_defaults(binary=False, source=False)
+    parser.set_defaults(binary=False, source=False, newest=1)
     parser.add_option("--revision",
                       help=("The revision whose files are to be listed."
                             " If not given, the latest revision is used."
@@ -31,7 +31,8 @@
     parser.add_option("--binary", action="store_true",
                       help=("List binary packages"))
     parser.add_option("--newest", type="int",
-                      help=("List binary packages"))
+                      help=("Number of newest revisions to list."
+                            " Defaults to 1."))
     return parser.parse_args()
 
 def parse_revision(raw_revision):
@@ -72,8 +73,6 @@
         candidates = [revpkg for revpkg in revisions
                       if revpkg.status.status.finished
                          and not revpkg.status.status.error]
-        if num_newest is None:
-            num_newest = 1
         candidates = candidates[:num_newest]
     else:
         for revpkg in revisions:



More information about the Treepkg-commits mailing list