← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/bugtasksearchparams-projectgroup into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/bugtasksearchparams-projectgroup into lp:launchpad.

Commit message:
Rename BugTaskSearchParams.project/setProject to projectgroup/setProjectGroup.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #523054 in Launchpad itself: "Rename Product.project to Product.projectgroup"
  https://bugs.launchpad.net/launchpad/+bug/523054

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/bugtasksearchparams-projectgroup/+merge/247858

Rename BugTaskSearchParams.project/setProject to projectgroup/setProjectGroup.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/bugtasksearchparams-projectgroup into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/buglisting.py'
--- lib/lp/bugs/browser/buglisting.py	2015-01-09 02:02:15 +0000
+++ lib/lp/bugs/browser/buglisting.py	2015-01-28 16:09:32 +0000
@@ -1717,7 +1717,7 @@
         elif IProduct.providedBy(self.context):
             search_params.setProduct(self.context)
         elif IProjectGroup.providedBy(self.context):
-            search_params.setProject(self.context)
+            search_params.setProjectGroup(self.context)
         elif (ISourcePackage.providedBy(self.context) or
               IDistributionSourcePackage.providedBy(self.context)):
             search_params.setSourcePackage(self.context)

=== modified file 'lib/lp/bugs/interfaces/bugtasksearch.py'
--- lib/lp/bugs/interfaces/bugtasksearch.py	2012-10-15 02:32:30 +0000
+++ lib/lp/bugs/interfaces/bugtasksearch.py	2015-01-28 16:09:32 +0000
@@ -151,7 +151,7 @@
     """
 
     product = None
-    project = None
+    projectgroup = None
     distribution = None
     distroseries = None
     productseries = None
@@ -244,9 +244,9 @@
         """Set the upstream context on which to filter the search."""
         self.product = product
 
-    def setProject(self, project):
+    def setProjectGroup(self, projectgroup):
         """Set the upstream context on which to filter the search."""
-        self.project = project
+        self.projectgroup = projectgroup
 
     def setDistribution(self, distribution):
         """Set the distribution context on which to filter the search."""
@@ -340,7 +340,7 @@
         elif IDistributionSourcePackage.providedBy(instance):
             self.setSourcePackage(target)
         elif IProjectGroup.providedBy(instance):
-            self.setProject(target)
+            self.setProjectGroup(target)
         else:
             raise AssertionError("unknown target type %r" % target)
 

=== modified file 'lib/lp/bugs/model/bugtasksearch.py'
--- lib/lp/bugs/model/bugtasksearch.py	2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugtasksearch.py	2015-01-28 16:09:32 +0000
@@ -427,12 +427,12 @@
         #     join_tables += tables
         #     extra_clauses += clauses
 
-    if params.project:
+    if params.projectgroup:
         clauseTables.append(Product)
         extra_clauses.append(And(
             BugTaskFlat.product_id == Product.id,
             search_value_to_storm_where_condition(
-                Product.project, params.project)))
+                Product.project, params.projectgroup)))
 
     if params.omit_dupes:
         extra_clauses.append(BugTaskFlat.duplicateof == None)
@@ -483,7 +483,7 @@
         # Milestones apply to all structural subscription searches.
         ss_clauses = [
             In(BugTaskFlat.milestone_id, Select(SS.milestoneID, tables=[SS]))]
-        if (params.project is None
+        if (params.projectgroup is None
             and params.product is None and params.productseries is None):
             # This search is *not* contrained to project related bugs, so
             # include distro, distroseries, DSP and SP subscriptions.
@@ -518,9 +518,9 @@
         if params.distribution is None and params.distroseries is None:
             # This search is *not* contrained to distro related bugs so
             # include products, productseries, and project group subscriptions.
-            project_match = True
-            if params.project is not None:
-                project_match = Product.project == params.project
+            projectgroup_match = True
+            if params.projectgroup is not None:
+                projectgroup_match = Product.project == params.projectgroup
             ss_clauses.append(In(
                 BugTaskFlat.product_id,
                 Select(SS.productID, tables=[SS])))
@@ -532,7 +532,7 @@
                 Select(Product.id, tables=[SS, Product],
                        where=And(
                            SS.projectID == Product.projectID,
-                           project_match,
+                           projectgroup_match,
                            Product.active))))
         extra_clauses.append(Or(*ss_clauses))
 

=== modified file 'lib/lp/bugs/model/tests/test_bugtasksearch.py'
--- lib/lp/bugs/model/tests/test_bugtasksearch.py	2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/tests/test_bugtasksearch.py	2015-01-28 16:09:32 +0000
@@ -1057,7 +1057,7 @@
             bugtasks=self.bugtasks2, owner=self.searchtarget2.owner)
 
     def setBugParamsTarget(self, params, target):
-        params.setProject(target)
+        params.setProjectGroup(target)
 
     def makeBugTasks(self, bugtarget=None, bugtasks=None, owner=None):
         """Create bug tasks for the search target."""

=== modified file 'lib/lp/registry/model/projectgroup.py'
--- lib/lp/registry/model/projectgroup.py	2014-09-09 09:57:28 +0000
+++ lib/lp/registry/model/projectgroup.py	2015-01-28 16:09:32 +0000
@@ -262,7 +262,7 @@
 
     def _customizeSearchParams(self, search_params):
         """Customize `search_params` for this milestone."""
-        search_params.setProject(self)
+        search_params.setProjectGroup(self)
 
     def _getOfficialTagClause(self):
         """See `OfficialBugTagTargetMixin`."""


Follow ups