Merge lp:~stevenk/launchpad/db-add-distro-parent into lp:launchpad/db-devel

Proposed by Steve Kowalik
Status: Work in progress
Proposed branch: lp:~stevenk/launchpad/db-add-distro-parent
Merge into: lp:launchpad/db-devel
Diff against target: 118 lines (+41/-0)
7 files modified
database/schema/patch-2207-99-0.sql (+7/-0)
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+2/-0)
lib/lp/registry/configure.zcml (+4/-0)
lib/lp/registry/doc/distroseries.txt (+21/-0)
lib/lp/registry/interfaces/distroseries.py (+5/-0)
lib/lp/registry/model/distroseries.py (+1/-0)
lib/lp/registry/stories/webservice/xx-distroseries.txt (+1/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/db-add-distro-parent
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+41430@code.launchpad.net
To post a comment you must log in.
9533. By Steve Kowalik

Twiddle text in the doctest

Unmerged revisions

9533. By Steve Kowalik

Twiddle text in the doctest

9532. By Steve Kowalik

Stop dropping .parent

9531. By Steve Kowalik

Merge db-devel

9530. By Steve Kowalik

First shot at adding a derived_from column

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2207-99-0.sql'
2--- database/schema/patch-2207-99-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2207-99-0.sql 2010-11-25 08:00:42 +0000
4@@ -0,0 +1,7 @@
5+SET client_min_messages=ERROR;
6+
7+ALTER TABLE DistroSeries
8+ ADD COLUMN derived_from INTEGER REFERENCES DistroSeries;
9+CREATE INDEX distroseries__derived_from__idx ON DistroSeries(derived_from);
10+
11+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 99, 0);
12
13=== modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py'
14--- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-11-17 22:18:34 +0000
15+++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-11-25 08:00:42 +0000
16@@ -375,6 +375,8 @@
17 IDistroSeries, 'main_archive', IArchive)
18 patch_reference_property(
19 IDistroSeries, 'distribution', IDistribution)
20+patch_reference_property(
21+ IDistroSeries, 'derived_from', IDistroSeries)
22 patch_choice_parameter_type(
23 IDistroSeries, 'getPackageUploads', 'status', PackageUploadStatus)
24 patch_choice_parameter_type(
25
26=== modified file 'lib/lp/registry/configure.zcml'
27--- lib/lp/registry/configure.zcml 2010-11-11 03:19:18 +0000
28+++ lib/lp/registry/configure.zcml 2010-11-25 08:00:42 +0000
29@@ -209,6 +209,10 @@
30 permission="launchpad.Moderate"
31 set_attributes="version name status owner nominatedarchindep changeslist datereleased"/>
32
33+ <require
34+ permission="launchpad.Commercial"
35+ set_attributes="derived_from"/>
36+
37 <!-- IStructuralSubscriptionTarget -->
38
39 <allow
40
41=== modified file 'lib/lp/registry/doc/distroseries.txt'
42--- lib/lp/registry/doc/distroseries.txt 2010-11-02 05:48:54 +0000
43+++ lib/lp/registry/doc/distroseries.txt 2010-11-25 08:00:42 +0000
44@@ -402,6 +402,26 @@
45 mozilla-firefox
46 netapplet
47
48+Derived Distroseries
49+--------------------
50+
51+Distroseries can be marked as deriving from another distroseries. This is
52+useful for Ubuntu, in as such that Ubuntu can be marked as deriving from
53+Debian sid, and distribution contributors can easily see the differences
54+between the latest packages in Ubuntu and Debian.
55+
56+Distroseries can not be marked in such a way, except if you are an admin.
57+
58+ >>> joe = factory.makePerson(name='joe')
59+ >>> login_person(joe)
60+ >>> bumpy.derived_from = warty
61+ Traceback (most recent call last):
62+ ...
63+ Unauthorized: (<DistroSeries ...>, 'derived_from', 'launchpad.Commercial')
64+ >>> logout()
65+ >>> login('admin@canonical.com')
66+ >>> bumpy.derived_from = warty
67+ >>> logout()
68
69 Translatable Packages and Packaging
70 -----------------------------------
71@@ -477,6 +497,7 @@
72 list of up to five packages that are the most recently linked to an
73 upstream.
74
75+ >>> login("foo.bar@canonical.com")
76 >>> distribution = factory.makeDistribution()
77 >>> distroseries = factory.makeDistroRelease(distribution=distribution)
78 >>> pkgs = distroseries.getMostRecentlyLinkedPackagings()
79
80=== modified file 'lib/lp/registry/interfaces/distroseries.py'
81--- lib/lp/registry/interfaces/distroseries.py 2010-11-08 12:09:21 +0000
82+++ lib/lp/registry/interfaces/distroseries.py 2010-11-25 08:00:42 +0000
83@@ -354,6 +354,11 @@
84 description=_(
85 "Whether or not this series is currently supported.")))
86
87+ derived_from = exported(
88+ Reference(
89+ Interface, # Really IDistroSeries
90+ title=_('Parent Distroseries')))
91+
92 def isUnstable():
93 """Whether or not a distroseries is unstable.
94
95
96=== modified file 'lib/lp/registry/model/distroseries.py'
97--- lib/lp/registry/model/distroseries.py 2010-11-12 20:04:22 +0000
98+++ lib/lp/registry/model/distroseries.py 2010-11-25 08:00:42 +0000
99@@ -256,6 +256,7 @@
100 sections = SQLRelatedJoin(
101 'Section', joinColumn='distroseries', otherColumn='section',
102 intermediateTable='SectionSelection')
103+ derived_from = ForeignKey(foreignKey='DistroSeries', notNull=False)
104
105 @property
106 def named_version(self):
107
108=== modified file 'lib/lp/registry/stories/webservice/xx-distroseries.txt'
109--- lib/lp/registry/stories/webservice/xx-distroseries.txt 2010-06-09 08:26:26 +0000
110+++ lib/lp/registry/stories/webservice/xx-distroseries.txt 2010-11-25 08:00:42 +0000
111@@ -66,6 +66,7 @@
112 changeslist: u'hoary-changes@ubuntu.com'
113 date_created: u'2006-10-16T18:31:43.483559+00:00'
114 datereleased: None
115+ derived_from_link: None
116 description: u'Hoary is the ...
117 displayname: u'Hoary'
118 distribution_link: u'http://.../ubuntu'

Subscribers

People subscribed via source and target branches

to status/vote changes: