Merge lp:~cjwatson/launchpad/pillarname-projectgroup into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: no longer in the source branch.
Merged at revision: 17322
Proposed branch: lp:~cjwatson/launchpad/pillarname-projectgroup
Merge into: lp:launchpad
Diff against target: 172 lines (+21/-20)
8 files modified
lib/lp/code/model/branchlookup.py (+3/-3)
lib/lp/code/model/branchnamespace.py (+1/-1)
lib/lp/registry/doc/pillar.txt (+3/-2)
lib/lp/registry/interfaces/pillar.py (+1/-1)
lib/lp/registry/interfaces/projectgroup.py (+2/-2)
lib/lp/registry/model/pillar.py (+8/-8)
lib/lp/registry/vocabularies.py (+2/-2)
lib/lp/services/fields/__init__.py (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/pillarname-projectgroup
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+247978@code.launchpad.net

Commit message

Rename PillarName.project to PillarName.projectgroup.

Description of the change

Rename PillarName.project to PillarName.projectgroup.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/model/branchlookup.py'
2--- lib/lp/code/model/branchlookup.py 2013-06-20 05:50:00 +0000
3+++ lib/lp/code/model/branchlookup.py 2015-01-29 13:22:14 +0000
4@@ -103,9 +103,9 @@
5 pillar = getUtility(IPillarNameSet).getByName(name)
6 if pillar is None:
7 # Actually, the pillar is no such *anything*. The user might be
8- # trying to refer to a project, a distribution or a product. We
9- # raise a NoSuchProduct error since that's what we used to raise
10- # when we only supported product & junk branches.
11+ # trying to refer to a project group, a distribution or a
12+ # project. We raise a NoSuchProduct error since that's what we
13+ # used to raise when we only supported project & junk branches.
14 raise NoSuchProduct(name)
15 return pillar
16
17
18=== modified file 'lib/lp/code/model/branchnamespace.py'
19--- lib/lp/code/model/branchnamespace.py 2013-06-20 05:50:00 +0000
20+++ lib/lp/code/model/branchnamespace.py 2015-01-29 13:22:14 +0000
21@@ -538,7 +538,7 @@
22 If the given name is '+junk' or None, return None.
23
24 :raise NoSuchProduct if there's no pillar with the given name or it is
25- a project.
26+ a project group.
27 """
28 if pillar_name == '+junk':
29 return None
30
31=== modified file 'lib/lp/registry/doc/pillar.txt'
32--- lib/lp/registry/doc/pillar.txt 2011-12-24 17:49:30 +0000
33+++ lib/lp/registry/doc/pillar.txt 2015-01-29 13:22:14 +0000
34@@ -39,8 +39,9 @@
35 ...
36 NotFoundError: 'fnord'
37
38-Inactive products/projects are not available through PillarNameSet unless we
39-use the special getByName() method which returns active/inactive pillars..
40+Inactive projects/project groups are not available through PillarNameSet
41+unless we use the special getByName() method which returns active/inactive
42+pillars.
43
44 >>> 'gimp' in pillar_set
45 True
46
47=== modified file 'lib/lp/registry/interfaces/pillar.py'
48--- lib/lp/registry/interfaces/pillar.py 2014-11-28 22:28:40 +0000
49+++ lib/lp/registry/interfaces/pillar.py 2015-01-29 13:22:14 +0000
50@@ -116,7 +116,7 @@
51 id = Int(title=_('The PillarName ID'))
52 name = TextLine(title=u"The name.")
53 product = Attribute('The project that has this name, or None')
54- project = Attribute('The project that has this name, or None')
55+ projectgroup = Attribute('The project group that has this name, or None')
56 distribution = Attribute('The distribution that has this name, or None')
57 active = Attribute('The pillar is active')
58 pillar = Attribute('The pillar object')
59
60=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
61--- lib/lp/registry/interfaces/projectgroup.py 2015-01-29 10:35:21 +0000
62+++ lib/lp/registry/interfaces/projectgroup.py 2015-01-29 13:22:14 +0000
63@@ -88,7 +88,7 @@
64 from lp.translations.interfaces.translationpolicy import ITranslationPolicy
65
66
67-class ProjectNameField(PillarNameField):
68+class ProjectGroupNameField(PillarNameField):
69
70 @property
71 def _content_iface(self):
72@@ -103,7 +103,7 @@
73 description=_("Whether or not this project group has been "
74 "reviewed.")))
75 name = exported(
76- ProjectNameField(
77+ ProjectGroupNameField(
78 title=_('Name'),
79 required=True,
80 description=_(
81
82=== modified file 'lib/lp/registry/model/pillar.py'
83--- lib/lp/registry/model/pillar.py 2013-06-20 05:50:00 +0000
84+++ lib/lp/registry/model/pillar.py 2015-01-29 13:22:14 +0000
85@@ -137,12 +137,12 @@
86 "One (and only one) of product, project or distribution may be "
87 "NOT NULL: %s" % row[1:])
88
89- id, product, project, distribution = row
90+ id, product, projectgroup, distribution = row
91
92 if product is not None:
93 return getUtility(IProductSet).get(product)
94- elif project is not None:
95- return getUtility(IProjectGroupSet).get(project)
96+ elif projectgroup is not None:
97+ return getUtility(IProjectGroupSet).get(projectgroup)
98 else:
99 return getUtility(IDistributionSet).get(distribution)
100
101@@ -161,7 +161,7 @@
102 LeftJoin(
103 OtherPillarName, PillarName.alias_for == OtherPillarName.id),
104 LeftJoin(Product, PillarName.product == Product.id),
105- LeftJoin(ProjectGroup, PillarName.project == ProjectGroup.id),
106+ LeftJoin(ProjectGroup, PillarName.projectgroup == ProjectGroup.id),
107 LeftJoin(
108 Distribution, PillarName.distribution == Distribution.id),
109 ]
110@@ -231,7 +231,7 @@
111 stacklevel=2)
112 pillars = []
113 # Prefill pillar.product.licenses.
114- for pillar_name, other, product, project, distro, licenses in (
115+ for pillar_name, other, product, projectgroup, distro, licenses in (
116 result[:limit]):
117 pillar = pillar_name.pillar
118 if IProduct.providedBy(pillar):
119@@ -281,7 +281,7 @@
120 dbName='name', notNull=True, unique=True, alternateID=True)
121 product = ForeignKey(
122 foreignKey='Product', dbName='product')
123- project = ForeignKey(
124+ projectgroup = ForeignKey(
125 foreignKey='ProjectGroup', dbName='project')
126 distribution = ForeignKey(
127 foreignKey='Distribution', dbName='distribution')
128@@ -297,8 +297,8 @@
129
130 if pillar_name.distribution is not None:
131 return pillar_name.distribution
132- elif pillar_name.project is not None:
133- return pillar_name.project
134+ elif pillar_name.projectgroup is not None:
135+ return pillar_name.projectgroup
136 elif pillar_name.product is not None:
137 return pillar_name.product
138 else:
139
140=== modified file 'lib/lp/registry/vocabularies.py'
141--- lib/lp/registry/vocabularies.py 2014-10-22 20:39:04 +0000
142+++ lib/lp/registry/vocabularies.py 2015-01-29 13:22:14 +0000
143@@ -1776,7 +1776,7 @@
144
145 @property
146 def filter_terms(self):
147- return [PillarName.project != None]
148+ return [PillarName.projectgroup != None]
149
150
151 class VocabularyFilterDistribution(VocabularyFilter):
152@@ -1863,7 +1863,7 @@
153 class DistributionOrProductVocabulary(PillarVocabularyBase):
154 """Active `IDistribution` or `IProduct` objects vocabulary."""
155 displayname = 'Select a project'
156- _filter = [PillarName.project == None, PillarName.active == True]
157+ _filter = [PillarName.projectgroup == None, PillarName.active == True]
158
159 def __contains__(self, obj):
160 if IProduct.providedBy(obj):
161
162=== modified file 'lib/lp/services/fields/__init__.py'
163--- lib/lp/services/fields/__init__.py 2012-10-10 03:47:59 +0000
164+++ lib/lp/services/fields/__init__.py 2015-01-29 13:22:14 +0000
165@@ -795,7 +795,7 @@
166
167
168 class PillarNameField(BlacklistableContentNameField):
169- """Base field used for names of distros/projects/products."""
170+ """Base field used for names of distros/project groups/products."""
171
172 errormessage = _("%s is already used by another project")
173