sort products, components before displaying them. If there's a natural ordering, it doesn't seem like a useful one
authorSteve Fink <sfink@mozilla.com>
Wed, 01 Feb 2012 13:13:33 -0800
changeset 75 b3bf1897c3609dffa4a4b604e0940bdbb74d45aa
parent 74 a0d42f74e9a44f690b811724d58396f68527bc10
child 76 e694636e6fcb4aba1fa32bac42f2d0b51fc6fea4
push id34
push usersfink@mozilla.com
push dateFri, 03 Feb 2012 18:07:20 +0000
sort products, components before displaying them. If there's a natural ordering, it doesn't seem like a useful one
bzexport.py
--- a/bzexport.py
+++ b/bzexport.py
@@ -815,17 +815,17 @@ def choose_prodcomponent(ui, c, orig_pro
 
     # 'products' and 'components' will be the set of valid products/components
     # remaining after filtering by the 'product' and 'component' passed in
     products = all_products
     components = set()
 
     if product is None:
         if component is None:
-            product = choose_value(ui, 'product', all_products,
+            product = choose_value(ui, 'product', sorted(all_products),
                                    message = "Possible Products:",
                                    usemenu = finalize)
             if product is not None:
                 products = [ product ]
         else:
             # Inverted lookup: find products matching the given component (or
             # substring of a component)
             products = []
@@ -844,31 +844,31 @@ def choose_prodcomponent(ui, c, orig_pro
     # case if there are multiple possibilities, the passed-in value will be
     # preserved)
 
     if len(products) == 0:
         product = None
     elif len(products) == 1:
         product = products.pop()
     else:
-        product = choose_value(ui, 'product', products,
+        product = choose_value(ui, 'product', sorted(products),
                                message = "Select from these products:",
                                usemenu = finalize)
         if product is not None:
             prodcomponents = products_info[product]['component'].keys()
             components = set(components).intersection(prodcomponents)
         else:
             product = orig_product
 
     if len(components) == 0:
         component = None
     elif len(components) == 1:
         component = components.pop()
     else:
-        component = choose_value(ui, 'component', components,
+        component = choose_value(ui, 'component', sorted(components),
                                  message = "Select from these components:",
                                  usemenu = finalize)
         if component is None:
             component = orig_component
 
     return (product, component)
 
 def fill_values(values, ui, api_server, reviewers = None, finalize = False):