[jhbuild/release-team-commands] simpler format for bugs and false positives files when there is a single check



commit b90849367d5aa6c76e3cb16b241dcbb77642c45a
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri May 15 10:08:42 2009 +0200

    simpler format for bugs and false positives files when there is a single check
---
 jhbuild/commands/goalreport.py |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/jhbuild/commands/goalreport.py b/jhbuild/commands/goalreport.py
index 92793ad..dfd597c 100644
--- a/jhbuild/commands/goalreport.py
+++ b/jhbuild/commands/goalreport.py
@@ -287,12 +287,12 @@ class cmd_goalreport(Command):
         else:
             output = sys.stdout
 
-        self.load_bugs(options.bugfile)
-        self.load_false_positives(options.falsepositivesfile)
-
         if not self.checks:
             self.load_checks_from_options(options.checks)
 
+        self.load_bugs(options.bugfile)
+        self.load_false_positives(options.falsepositivesfile)
+
         config.devhelp_dirname = options.devhelp_dirname
 
         module_set = jhbuild.moduleset.load(config)
@@ -562,6 +562,9 @@ class cmd_goalreport(Command):
         #  $(module)/$(checkname) $(bugnumber)
         # Sample bug file:
         #  evolution/LibGnomeCanvas 571742
+        #
+        # also, if there is only a single check, the /$(checkname) part
+        # can be skipped.
         self.bugs = {}
         if not filename:
             return
@@ -578,7 +581,13 @@ class cmd_goalreport(Command):
             if line.startswith('#'):
                 continue
             part, bugnumber = line.split()
-            module_name, check = part.split('/')
+            if '/' in part:
+                module_name, check = part.split('/')
+            elif len(self.checks) == 1:
+                module_name = part
+                check = self.checks[0].__name__
+            else:
+                continue
             self.bugs[(module_name, check)] = bugnumber
 
         self.bug_status = {}
@@ -613,7 +622,15 @@ class cmd_goalreport(Command):
                 part, extra = line.split(' ', 1)
             else:
                 part, extra = line, '-'
-            module_name, check = part.split('/')
+
+            if '/' in part:
+                module_name, check = part.split('/')
+            elif len(self.checks) == 1:
+                module_name = part
+                check = self.checks[0].__name__
+            else:
+                continue
+
             self.false_positives[(module_name, check)] = extra
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]