← Back to team overview

launchpad-reviewers team mailing list archive

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

 

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

Commit message:
Rename IBranchCollection.inProject and IRevisionCollection.inProject to IBranchCollection.inProjectGroup and IRevisionCollection.inProjectGroup.

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/bazaar-projectgroup/+merge/247866

Rename IBranchCollection.inProject and IRevisionCollection.inProject to IBranchCollection.inProjectGroup and IRevisionCollection.inProjectGroup.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/bazaar-projectgroup into lp:launchpad.
=== modified file 'lib/lp/code/adapters/branchcollection.py'
--- lib/lp/code/adapters/branchcollection.py	2011-05-09 19:09:44 +0000
+++ lib/lp/code/adapters/branchcollection.py	2015-01-28 16:44:03 +0000
@@ -9,7 +9,7 @@
     'branch_collection_for_distro_series',
     'branch_collection_for_person',
     'branch_collection_for_product',
-    'branch_collection_for_project',
+    'branch_collection_for_project_group',
     'branch_collection_for_source_package',
     'branch_collection_for_distro_source_package',
     ]
@@ -25,9 +25,9 @@
     return getUtility(IAllBranches).inProduct(product)
 
 
-def branch_collection_for_project(project):
-    """Adapt a project to a branch collection."""
-    return getUtility(IAllBranches).inProject(project)
+def branch_collection_for_project_group(project_group):
+    """Adapt a project group to a branch collection."""
+    return getUtility(IAllBranches).inProjectGroup(project_group)
 
 
 def branch_collection_for_person(person):

=== modified file 'lib/lp/code/adapters/revisioncache.py'
--- lib/lp/code/adapters/revisioncache.py	2009-09-02 10:36:33 +0000
+++ lib/lp/code/adapters/revisioncache.py	2015-01-28 16:44:03 +0000
@@ -9,7 +9,7 @@
     'revision_cache_for_distro_series',
     'revision_cache_for_person',
     'revision_cache_for_product',
-    'revision_cache_for_project',
+    'revision_cache_for_project_group',
     'revision_cache_for_source_package',
     'revision_cache_for_distro_source_package',
     ]
@@ -25,9 +25,9 @@
     return getUtility(IRevisionCache).inProduct(product)
 
 
-def revision_cache_for_project(project):
-    """Adapt a project to a revision cache."""
-    return getUtility(IRevisionCache).inProject(project)
+def revision_cache_for_project_group(project_group):
+    """Adapt a project group to a revision cache."""
+    return getUtility(IRevisionCache).inProjectGroup(project_group)
 
 
 def revision_cache_for_person(person):

=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py	2014-12-08 00:32:30 +0000
+++ lib/lp/code/browser/branchlisting.py	2015-01-28 16:44:03 +0000
@@ -1336,7 +1336,7 @@
     show_series_links = True
 
     def _getCollection(self):
-        return getUtility(IAllBranches).inProject(self.context)
+        return getUtility(IAllBranches).inProjectGroup(self.context)
 
     @property
     def no_branch_message(self):

=== modified file 'lib/lp/code/configure.zcml'
--- lib/lp/code/configure.zcml	2014-11-28 22:07:05 +0000
+++ lib/lp/code/configure.zcml	2015-01-28 16:44:03 +0000
@@ -132,7 +132,7 @@
   <adapter
       for="lp.registry.interfaces.projectgroup.IProjectGroup"
       provides="lp.code.interfaces.branchcollection.IBranchCollection"
-      factory="lp.code.adapters.branchcollection.branch_collection_for_project"/>
+      factory="lp.code.adapters.branchcollection.branch_collection_for_project_group"/>
   <adapter
       for="lp.registry.interfaces.distribution.IDistribution"
       provides="lp.code.interfaces.branchcollection.IBranchCollection"
@@ -178,7 +178,7 @@
   <adapter
       for="lp.registry.interfaces.projectgroup.IProjectGroup"
       provides="lp.code.interfaces.revisioncache.IRevisionCache"
-      factory="lp.code.adapters.revisioncache.revision_cache_for_project"/>
+      factory="lp.code.adapters.revisioncache.revision_cache_for_project_group"/>
   <adapter
       for="lp.registry.interfaces.distribution.IDistribution"
       provides="lp.code.interfaces.revisioncache.IRevisionCache"

=== modified file 'lib/lp/code/feed/branch.py'
--- lib/lp/code/feed/branch.py	2013-02-13 02:48:20 +0000
+++ lib/lp/code/feed/branch.py	2015-01-28 16:44:03 +0000
@@ -187,7 +187,7 @@
     usedfor = IProjectGroup
 
     def _getCollection(self):
-        return getUtility(IAllBranches).inProject(self.context)
+        return getUtility(IAllBranches).inProjectGroup(self.context)
 
 
 class PersonBranchFeed(BranchListingFeed):
@@ -362,7 +362,7 @@
 
     def _getRevisionCache(self):
         """See `RevisionListingFeed`."""
-        return getUtility(IRevisionCache).inProject(self.context)
+        return getUtility(IRevisionCache).inProjectGroup(self.context)
 
 
 class RevisionPerson:

=== modified file 'lib/lp/code/interfaces/branchcollection.py'
--- lib/lp/code/interfaces/branchcollection.py	2013-02-12 22:30:49 +0000
+++ lib/lp/code/interfaces/branchcollection.py	2015-01-28 16:44:03 +0000
@@ -126,8 +126,8 @@
     def inProduct(product):
         """Restrict the collection to branches in 'product'."""
 
-    def inProject(project):
-        """Restrict the collection to branches in 'project'."""
+    def inProjectGroup(projectgroup):
+        """Restrict the collection to branches in 'projectgroup'."""
 
     def inSourcePackage(package):
         """Restrict the collection to branches in 'package'.

=== modified file 'lib/lp/code/interfaces/revisioncache.py'
--- lib/lp/code/interfaces/revisioncache.py	2013-01-07 02:40:55 +0000
+++ lib/lp/code/interfaces/revisioncache.py	2015-01-28 16:44:03 +0000
@@ -56,8 +56,8 @@
     def inProduct(product):
         """Restrict to revisions in branches in 'product'."""
 
-    def inProject(project):
-        """Restrict to revisions in branches in 'project'."""
+    def inProjectGroup(projectgroup):
+        """Restrict to revisions in branches in 'projectgroup'."""
 
     def inSourcePackage(package):
         """Restrict to revisions in branches in 'package'.

=== modified file 'lib/lp/code/model/branchcollection.py'
--- lib/lp/code/model/branchcollection.py	2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/branchcollection.py	2015-01-28 16:44:03 +0000
@@ -540,10 +540,10 @@
         return self._filterBy(
             [Branch.product == product], exclude_from_search=['product'])
 
-    def inProject(self, project):
+    def inProjectGroup(self, projectgroup):
         """See `IBranchCollection`."""
         return self._filterBy(
-            [Product.project == project.id],
+            [Product.project == projectgroup.id],
             table=Product, join=Join(Product, Branch.product == Product.id))
 
     def inDistribution(self, distribution):

=== modified file 'lib/lp/code/model/revisioncache.py'
--- lib/lp/code/model/revisioncache.py	2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/revisioncache.py	2015-01-28 16:44:03 +0000
@@ -105,11 +105,11 @@
         return self._filterBy(
             [RevisionCache.product == product])
 
-    def inProject(self, project):
+    def inProjectGroup(self, projectgroup):
         """See `IRevisionCollection`."""
         return self._filterBy(
             [RevisionCache.product == Product.id,
-             Product.project == project])
+             Product.project == projectgroup])
 
     def inSourcePackage(self, package):
         """See `IRevisionCollection`."""

=== modified file 'lib/lp/code/model/tests/test_branchcollection.py'
--- lib/lp/code/model/tests/test_branchcollection.py	2014-01-30 15:04:06 +0000
+++ lib/lp/code/model/tests/test_branchcollection.py	2015-01-28 16:44:03 +0000
@@ -285,15 +285,15 @@
         collection = self.all_branches.inProduct(branch.product)
         self.assertEqual([branch], list(collection.getBranches()))
 
-    def test_inProject(self):
-        # 'inProject' returns a new collection restricted to branches in the
-        # given project.
+    def test_inProjectGroup(self):
+        # 'inProjectGroup' returns a new collection restricted to branches
+        # in the given project group.
         branch = self.factory.makeProductBranch()
         self.factory.makeProductBranch()
         self.factory.makeAnyBranch()
-        project = self.factory.makeProject()
-        removeSecurityProxy(branch.product).project = project
-        collection = self.all_branches.inProject(project)
+        projectgroup = self.factory.makeProject()
+        removeSecurityProxy(branch.product).project = projectgroup
+        collection = self.all_branches.inProjectGroup(projectgroup)
         self.assertEqual([branch], list(collection.getBranches()))
 
     def test_isExclusive(self):

=== modified file 'lib/lp/code/model/tests/test_revisioncache.py'
--- lib/lp/code/model/tests/test_revisioncache.py	2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/tests/test_revisioncache.py	2015-01-28 16:44:03 +0000
@@ -187,19 +187,20 @@
         revision_cache = getUtility(IRevisionCache).inProduct(product)
         self.assertCollectionContents([rev1, rev2], revision_cache)
 
-    def test_in_project(self):
+    def test_in_project_group(self):
         # Revisions across a project group can be determined using the
-        # inProject method.
-        project = self.factory.makeProject()
-        product1 = self.factory.makeProduct(project=project)
-        product2 = self.factory.makeProduct(project=project)
+        # inProjectGroup method.
+        projectgroup = self.factory.makeProject()
+        product1 = self.factory.makeProduct(project=projectgroup)
+        product2 = self.factory.makeProduct(project=projectgroup)
         rev1 = self.makeCachedRevision(product=product1)
         rev2 = self.makeCachedRevision(product=product2)
-        # Make two other revisions, on in a different product, and another
+        # Make two other revisions, one in a different product, and another
         # general one.
         self.makeCachedRevision(product=self.factory.makeProduct())
         self.makeCachedRevision()
-        revision_cache = getUtility(IRevisionCache).inProject(project)
+        revision_cache = getUtility(IRevisionCache).inProjectGroup(
+            projectgroup)
         self.assertCollectionContents([rev1, rev2], revision_cache)
 
     def test_in_source_package(self):


Follow ups