Merge lp:~cjwatson/launchpad/delete-more-component-ui into lp:launchpad

Proposed by Colin Watson on 2015-11-24
Status: Merged
Merged at revision: 17855
Proposed branch: lp:~cjwatson/launchpad/delete-more-component-ui
Merge into: lp:launchpad
Diff against target: 127 lines (+19/-21)
7 files modified
lib/lp/registry/interfaces/sourcepackage.py (+2/-1)
lib/lp/registry/model/sourcepackage.py (+6/-4)
lib/lp/registry/templates/sourcepackage-index.pt (+4/-3)
lib/lp/registry/templates/sourcepackage-portlet-details.pt (+0/-4)
lib/lp/soyuz/browser/tests/sourcepackage-views.txt (+7/-3)
lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt (+0/-2)
lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt (+0/-4)
To merge this branch: bzr merge lp:~cjwatson/launchpad/delete-more-component-ui
Reviewer Review Type Date Requested Status
William Grant code 2015-11-24 Approve on 2015-11-30
Review via email: mp+278393@code.launchpad.net

Commit Message

Remove some more uses of the confusing .dsc component. Add the publishing component to SourcePackage:+index in compensation.

Description of the Change

Remove some more uses of the confusing .dsc component, this time in DistributionSourcePackageRelease:+index and SourcePackage:+portlet-details. As with https://code.launchpad.net/~cjwatson/launchpad/delete-dsp-component-ui/+merge/270169, showing it does more harm than good, e.g.:

  http://irclogs.ubuntu.com/2015/11/23/%23ubuntu-devel.html#t16:16

In compensation, add the publishing component to the publishing history summary on SourcePackage:+index, since it makes some degree of sense there and is useful for the same kind of reason it's useful in other publishing history views. It's already shown elsewhere on DistributionSourcePackageRelease:+index.

To post a comment you must log in.
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
2--- lib/lp/registry/interfaces/sourcepackage.py 2015-10-12 16:16:28 +0000
3+++ lib/lp/registry/interfaces/sourcepackage.py 2015-11-24 01:59:56 +0000
4@@ -154,7 +154,8 @@
5 published_by_pocket = Attribute("The set of source package releases "
6 "currently published in this distro series, organised by "
7 "pocket. The result is a dictionary, with the pocket dbschema "
8- "as a key, and a list of source package releases as the value.")
9+ "as a key, and a list of {'spr': source package release, "
10+ "'component_name': component name} as the value.")
11
12 linked_branches = Attribute(
13 "A mapping of pockets to officially linked branches, ordered by "
14
15=== modified file 'lib/lp/registry/model/sourcepackage.py'
16--- lib/lp/registry/model/sourcepackage.py 2015-10-12 16:16:28 +0000
17+++ lib/lp/registry/model/sourcepackage.py 2015-11-24 01:59:56 +0000
18@@ -1,4 +1,4 @@
19-# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
20+# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
21 # GNU Affero General Public License version 3 (see the file LICENSE).
22
23 """Database classes that implement SourcePackage items."""
24@@ -422,9 +422,11 @@
25 thedict[pocket] = []
26 # add all the sourcepackagereleases in the right place
27 for spph in result:
28- thedict[spph.pocket].append(
29- spph.distroseries.distribution.getSourcePackageRelease(
30- spph.sourcepackagerelease))
31+ thedict[spph.pocket].append({
32+ 'spr': spph.distroseries.distribution.getSourcePackageRelease(
33+ spph.sourcepackagerelease),
34+ 'component_name': spph.component_name,
35+ })
36 return thedict
37
38 @property
39
40=== modified file 'lib/lp/registry/templates/sourcepackage-index.pt'
41--- lib/lp/registry/templates/sourcepackage-index.pt 2014-11-09 01:48:36 +0000
42+++ lib/lp/registry/templates/sourcepackage-index.pt 2015-11-24 01:59:56 +0000
43@@ -38,9 +38,10 @@
44 The description of the pocket.
45 </p>
46 <ul>
47- <li tal:repeat="spr pocket/packages">
48- <a tal:content="spr/displayname"
49- tal:attributes="href spr/fmt:url">apache2</a>
50+ <li tal:repeat="package pocket/packages">
51+ <a tal:content="package/spr/displayname"
52+ tal:attributes="href package/spr/fmt:url">apache2</a>
53+ (<span tal:content="package/component_name">main</span>)
54 </li>
55 </ul>
56 </dd>
57
58=== modified file 'lib/lp/registry/templates/sourcepackage-portlet-details.pt'
59--- lib/lp/registry/templates/sourcepackage-portlet-details.pt 2009-09-14 04:24:20 +0000
60+++ lib/lp/registry/templates/sourcepackage-portlet-details.pt 2015-11-24 01:59:56 +0000
61@@ -24,10 +24,6 @@
62 <dt>Urgency:</dt>
63 <dd><span tal:content="current/urgency/title" /></dd>
64 </dl>
65- <dl>
66- <dt>Component:</dt>
67- <dd><span tal:content="current/component/name"/></dd>
68- </dl>
69 </tal:currentrelease>
70 <tal:norelease tal:condition="not: current">
71 <em>No published releases of this package have been uploaded in
72
73=== modified file 'lib/lp/soyuz/browser/tests/sourcepackage-views.txt'
74--- lib/lp/soyuz/browser/tests/sourcepackage-views.txt 2015-07-30 09:02:18 +0000
75+++ lib/lp/soyuz/browser/tests/sourcepackage-views.txt 2015-11-24 01:59:56 +0000
76@@ -27,16 +27,20 @@
77
78 [
79 {'pocketdetails': PackagePublishingPocket,
80- 'packages': [IDistributionSourcePackageRelease, ...]}
81+ 'packages': [
82+ {'spr': IDistributionSourcePackageRelease, 'component_name': 'main'},
83+ ...
84+ ]}
85 ...
86 ]
87
88 Each pocket should only contain packages marked as PUBLISHED.
89
90 >>> for pub in pmount_view.published_by_pocket():
91- ... pkg_versions = [p.version for p in pub['packages']]
92+ ... pkg_versions = [
93+ ... (p['spr'].version, p['component_name']) for p in pub['packages']]
94 ... print pub['pocketdetails'].title, sorted(pkg_versions)
95- Release [u'0.1-2']
96+ Release [(u'0.1-2', u'main')]
97 Security []
98 Updates []
99 Proposed []
100
101=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt'
102--- lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2015-10-05 06:34:17 +0000
103+++ lib/lp/soyuz/stories/soyuz/xx-distributionsourcepackagerelease-pages.txt 2015-11-24 01:59:56 +0000
104@@ -105,8 +105,6 @@
105 Breezy Badger Autotest
106 Original maintainer:
107 Maintainer
108- Component:
109- main
110 Architectures:
111 all
112 Section:
113
114=== modified file 'lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt'
115--- lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2014-11-09 21:51:44 +0000
116+++ lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt 2015-11-24 01:59:56 +0000
117@@ -55,10 +55,6 @@
118 >Foo Bar</dd>
119 </dl>
120 <dl>
121- <dt>Component:</dt>
122- <dd tal:content="context/component/name">main</dd>
123- </dl>
124- <dl>
125 <dt>Architectures:</dt>
126 <dd tal:content="context/architecturehintlist">i386, ppc</dd>
127 </dl>