launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02700
[Merge] lp:~lifeless/launchpad/bug-717394-2 into lp:launchpad
Robert Collins has proposed merging lp:~lifeless/launchpad/bug-717394-2 into lp:launchpad with lp:~lifeless/launchpad/bug-717394 as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~lifeless/launchpad/bug-717394-2/+merge/50557
use the pillar rather than collating across series to get milestones - drops another query per series from bug searches.
--
https://code.launchpad.net/~lifeless/launchpad/bug-717394-2/+merge/50557
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/bug-717394-2 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2011-02-21 08:14:22 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2011-02-21 08:14:23 +0000
@@ -1181,6 +1181,20 @@
return list(series)
@property
+ def milestones_list(self):
+ if IDistribution(self.context, None):
+ milestone_resultset = self.context.milestones
+ elif IProduct(self.context, None):
+ milestone_resultset = self.context.milestones
+ elif IDistroSeries(self.context, None):
+ milestone_resultset = self.context.distribution.milestones
+ elif IProductSeries(self.context, None):
+ milestone_resultset = self.context.product.milestones
+ else:
+ raise AssertionError("series_list called with illegal context")
+ return list(milestone_resultset)
+
+ @property
def series_buglistings(self):
"""Return a buglisting for each series.
@@ -1222,9 +1236,7 @@
"""Return a buglisting for each milestone."""
milestone_buglistings = []
bug_task_set = getUtility(IBugTaskSet)
- milestones = []
- reduce(lambda _, series:milestones.extend(series.milestones),
- self.series_list, [])
+ milestones = self.milestones_list
open_bugs = bug_task_set.open_bugtask_search
open_bugs.setTarget(any(*milestones))
counts = bug_task_set.countBugs(open_bugs, (BugTask.milestoneID,))