[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-103-g8f2f665

Sandro Tosi morph at debian.org
Wed May 12 17:27:20 UTC 2010


The following commit has been merged in the master branch:
commit 75973f6d2869f9cec136c54128cd7337c46e3db0
Author: Sandro Tosi <morph at debian.org>
Date:   Tue May 11 19:26:44 2010 +0200

    generate a list of pseudoheaders (without duplicates), so that when writing them into the report body they are not repeated; thanks to Cyril Brulebois for the report; Closes: #579597

diff --git a/debian/changelog b/debian/changelog
index 884a4e5..d45e0c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,8 +6,12 @@ reportbug (4.12.2) UNRELEASED; urgency=low
       and testing preliminary patches
     - correctly pass the 'timeout' parameter to 'check_built'; thanks to Daniel
       Bolton for the report and to Milan Vancura for the patch; Closes: #580382
+  * reportbug/utils.py
+    - generate a list of pseudoheaders (without duplicates), so that when
+      writing them into the report body they are not repeated; thanks to Cyril
+      Brulebois for the report; Closes: #579597
 
- -- Sandro Tosi <morph at debian.org>  Mon, 10 May 2010 22:34:14 +0200
+ -- Sandro Tosi <morph at debian.org>  Tue, 11 May 2010 19:23:40 +0200
 
 reportbug (4.12.1) unstable; urgency=low
 
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 74fa42b..0c472e8 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1053,14 +1053,23 @@ def cleanup_msg(dmessage, headers, pseudos, type):
                 ph += [header]
     else:
         ph2 = {}
+        # generate a list of pseudoheaders, but without duplicates
+        # we take the list of pseudoheaders defined in reportbug and add
+        # the ones passed by the user (if not already present). We are not using
+        # set(..) because we want to preserve the item order of PSEUDOHEADERS
+        pseudo_list = list(PSEUDOHEADERS)
+        for p in PSEUDOS:
+            if p not in pseudo_list:
+                pseudo_list.append(p)
+
         for header, content in pseudoheaders:
             # if either in the canonical pseudo-headers list or in those passed on the command line
-            if header in list(PSEUDOHEADERS) + PSEUDOS:
+            if header in pseudo_list:
                 ph2[header] = content
             else:
                 newheaders.append( (header, content) )
 
-        for header in list(PSEUDOHEADERS) + PSEUDOS:
+        for header in pseudo_list:
             if header in ph2:
                 ph += ['%s: %s' % (header, ph2[header])]
 

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list