bugzilla-close-candidate.py: Fix sorting of branches.
authorMartin Liska <mliska@suse.cz>
Fri, 29 May 2020 14:37:48 +0000 (16:37 +0200)
committerMartin Liska <mliska@suse.cz>
Fri, 29 May 2020 14:37:48 +0000 (16:37 +0200)
Pushed to master.

maintainer-scripts/ChangeLog:

* bugzilla-close-candidate.py: Fix sorting of branches.

maintainer-scripts/bugzilla-close-candidate.py

index 9c95f2bf3eb2454bac03566fe3553c8d0fc37761..cdace9763e7902af4395f469794776a3accf0b57 100755 (executable)
@@ -91,9 +91,10 @@ def search():
             if skip:
                 continue
 
-            branches = get_branches_by_comments(comments)
-            if len(branches):
-                branches_str = ','.join(sorted(list(branches)))
+            branches = sorted(list(get_branches_by_comments(comments)),
+                              key=lambda b: 999 if b is 'master' else int(b))
+            if branches:
+                branches_str = ','.join(branches)
                 print('%-30s%-30s%-40s%-40s%-60s' % ('https://gcc.gnu.org/PR%d' % id, branches_str, fail, work, b['summary']), flush=True)
                 ids.append(id)