[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 6.0-44-g97bc584

Sandro Tosi morph at debian.org
Sun Aug 28 14:22:50 UTC 2011


The following commit has been merged in the master branch:
commit 97bc584f2860770b81cbf199ee0d9c3f9150e583
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Aug 28 16:19:44 2011 +0200

    we need to sort also the (partial) bugs list of each section, else the hierarchy and the global bugs list are misaligned, hence selecting an item number will get the wrong bug report; thanks to Edward J. Shornock for the report; Closes: #639577

diff --git a/debian/changelog b/debian/changelog
index 64fe263..7d70f92 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,10 @@ reportbug (6.2) UNRELEASED; urgency=low
   * reportbug/ui/text_ui.py
     - don't try to decode a unicode string; thanks to Vincent Bernat for the
       report; Closes: #638429
+    - we need to sort also the (partial) bugs list of each section, else the
+      hierarchy and the global bugs list are misaligned, hence selecting an item
+      number will get the wrong bug report; thanks to Edward J. Shornock for the
+      report; Closes: #639577
   * reportbug/debbugs.py + dependeciens
     - make get_report() return the Bugreport instance, containing all the bug
       information; now the UI does the visualization part, and we just pass
@@ -55,7 +59,7 @@ reportbug (6.2) UNRELEASED; urgency=low
   * conf/reportbug.conf, man/reportbug.conf.5
     - complete manpage and example config file with all the accepted options
 
- -- Sandro Tosi <morph at debian.org>  Sun, 28 Aug 2011 15:35:16 +0200
+ -- Sandro Tosi <morph at debian.org>  Sun, 28 Aug 2011 16:16:48 +0200
 
 reportbug (6.1) unstable; urgency=low
 
diff --git a/reportbug/ui/text_ui.py b/reportbug/ui/text_ui.py
index e62279f..5b9ebd0 100644
--- a/reportbug/ui/text_ui.py
+++ b/reportbug/ui/text_ui.py
@@ -545,13 +545,18 @@ def handle_bts_query(package, bts, timeout, mirrors=None, http_proxy="",
             # first item is the title of the section
             entry_new = entry[0]
             bugs_new = []
+            bugs_numbers = []
+            # XXX: we can probably simplify this code, with some lists
+            # generations and map()
             # second item is a list of bugs report
             for bug in entry[1]:
                 # we take the info we need (bug number and subject)
                 bugs_new.append("#%d  %s" %(bug.bug_num, bug.subject))
-                # and at the same time create a list of bug number
-                bugs.append(bug.bug_num)
+                # and at the same time create a list of bugs numbers
+                bugs_numbers.append(bug.bug_num)
+            # then we sort both the lists
             hierarchy_new.append((entry_new, sorted(bugs_new, reverse=latest_first)))
+            bugs.extend(sorted(bugs_numbers, reverse=latest_first))
 
         # replace old hierarchy with hierarchy_new
         hierarchy = hierarchy_new

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list