Merge lp:~sinzui/launchpad/package-link-validation into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/package-link-validation
Merge into: lp:launchpad
Diff against target: 972 lines
23 files modified
lib/canonical/launchpad/browser/__init__.py (+0/-1)
lib/canonical/launchpad/database/__init__.py (+0/-1)
lib/canonical/launchpad/interfaces/__init__.py (+0/-1)
lib/canonical/launchpad/security.py (+1/-1)
lib/canonical/launchpad/zcml/configure.zcml (+0/-1)
lib/canonical/launchpad/zcml/packaging.zcml (+0/-32)
lib/lp/bugs/doc/distribution-upstream-bug-report.txt (+40/-29)
lib/lp/registry/browser/configure.zcml (+1/-1)
lib/lp/registry/browser/distributionsourcepackage.py (+1/-1)
lib/lp/registry/browser/packaging.py (+1/-1)
lib/lp/registry/browser/sourcepackage.py (+1/-1)
lib/lp/registry/browser/tests/test_packaging.py (+4/-2)
lib/lp/registry/browser/tests/test_person_view.py (+2/-1)
lib/lp/registry/configure.zcml (+23/-0)
lib/lp/registry/doc/sourcepackage.txt (+94/-59)
lib/lp/registry/model/distribution.py (+1/-1)
lib/lp/registry/model/distroseries.py (+2/-2)
lib/lp/registry/model/packaging.py (+2/-2)
lib/lp/registry/model/product.py (+2/-2)
lib/lp/registry/model/productseries.py (+2/-2)
lib/lp/registry/model/sourcepackage.py (+3/-3)
lib/lp/registry/tests/test_packaging.py (+4/-2)
utilities/migrater/migrater.py (+5/-3)
To merge this branch: bzr merge lp:~sinzui/launchpad/package-link-validation
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+13484@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my first branch to ensure valid upstream package links. There
are many oopses relating to the creation and efforts to fix invalid packages.
The root cause is a bad DB constraint and two views that do not do the
required sanity checks: +addPackage and +ubuntupkg

This branch is a set of mechanical changed made by the migrater script to
move packaging from canonical.launchpad to lp.registry

    lp:~sinzui/launchpad/package-link-validation
    Diff size: 395
    Launchpad bug: https://bugs.launchpad.net/bugs/453212
    Test command: ./bin/test -vv -t test_packaging \
                                 -t stories/packaging
    Pre-implementation: flacoste
    Target release: 3.1.10

== Rules ==

    * Run th migrator to take ownership of the problem code.

== QA ==

    * Visit any productseries that you are the owner or release manager of
    * Choose (+) Add package
    * Verify the page displays a for to choose a distroseries and source
      package.

== Lint ==

Linting changed files:
  lib/canonical/launchpad/security.py
  lib/canonical/launchpad/browser/__init__.py
  lib/canonical/launchpad/database/__init__.py
  lib/canonical/launchpad/interfaces/__init__.py
  lib/canonical/launchpad/zcml/configure.zcml
  lib/lp/registry/configure.zcml
  lib/lp/registry/browser/configure.zcml
  lib/lp/registry/browser/distributionsourcepackage.py
  lib/lp/registry/browser/packaging.py
  lib/lp/registry/browser/sourcepackage.py
  lib/lp/registry/browser/tests/test_packaging.py
  lib/lp/registry/browser/tests/test_person_view.py
  lib/lp/registry/model/distribution.py
  lib/lp/registry/model/distroseries.py
  lib/lp/registry/model/packaging.py
  lib/lp/registry/model/product.py
  lib/lp/registry/model/productseries.py
  lib/lp/registry/model/sourcepackage.py
  lib/lp/registry/stories/packaging/
  lib/lp/registry/tests/test_packaging.py
  utilities/migrater/migrater.py

== Test ==

No tests changed. The three migrated tests do work.

== Implementation ==

    * utilities/migrater/migrater.py
      Fixed errors that were committed some time ago.

Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/browser/__init__.py'
--- lib/canonical/launchpad/browser/__init__.py 2009-08-31 13:18:00 +0000
+++ lib/canonical/launchpad/browser/__init__.py 2009-10-16 20:36:17 +0000
@@ -48,7 +48,6 @@
48from canonical.launchpad.browser.oauth import *48from canonical.launchpad.browser.oauth import *
49from canonical.launchpad.browser.objectreassignment import *49from canonical.launchpad.browser.objectreassignment import *
50from canonical.launchpad.browser.packagerelationship import *50from canonical.launchpad.browser.packagerelationship import *
51from canonical.launchpad.browser.packaging import *
52from lp.registry.browser.peoplemerge import *51from lp.registry.browser.peoplemerge import *
53from lp.registry.browser.poll import *52from lp.registry.browser.poll import *
54from lp.soyuz.browser.publishedpackage import *53from lp.soyuz.browser.publishedpackage import *
5554
=== modified file 'lib/canonical/launchpad/database/__init__.py'
--- lib/canonical/launchpad/database/__init__.py 2009-09-17 21:13:06 +0000
+++ lib/canonical/launchpad/database/__init__.py 2009-10-16 20:36:17 +0000
@@ -56,7 +56,6 @@
5656
57from canonical.launchpad.database.account import *57from canonical.launchpad.database.account import *
58from canonical.launchpad.database.personnotification import *58from canonical.launchpad.database.personnotification import *
59from canonical.launchpad.database.packaging import *
60from canonical.launchpad.database.librarian import *59from canonical.launchpad.database.librarian import *
61from canonical.launchpad.database.binaryandsourcepackagename import *60from canonical.launchpad.database.binaryandsourcepackagename import *
62from canonical.launchpad.database.message import *61from canonical.launchpad.database.message import *
6362
=== modified file 'lib/canonical/launchpad/interfaces/__init__.py'
--- lib/canonical/launchpad/interfaces/__init__.py 2009-08-27 07:05:16 +0000
+++ lib/canonical/launchpad/interfaces/__init__.py 2009-10-16 20:36:17 +0000
@@ -94,7 +94,6 @@
94from canonical.launchpad.interfaces.oauth import *94from canonical.launchpad.interfaces.oauth import *
95from canonical.launchpad.interfaces.openidconsumer import *95from canonical.launchpad.interfaces.openidconsumer import *
96from canonical.launchpad.interfaces.packagerelationship import *96from canonical.launchpad.interfaces.packagerelationship import *
97from canonical.launchpad.interfaces.packaging import *
98from canonical.launchpad.interfaces.pathlookup import *97from canonical.launchpad.interfaces.pathlookup import *
99from lp.registry.interfaces.poll import *98from lp.registry.interfaces.poll import *
100from lp.soyuz.interfaces.processor import *99from lp.soyuz.interfaces.processor import *
101100
=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2009-09-25 00:59:30 +0000
+++ lib/canonical/launchpad/security.py 2009-10-16 20:36:17 +0000
@@ -71,7 +71,7 @@
71 IBinaryPackagePublishingHistory, ISourcePackagePublishingHistory)71 IBinaryPackagePublishingHistory, ISourcePackagePublishingHistory)
72from lp.soyuz.interfaces.queue import (72from lp.soyuz.interfaces.queue import (
73 IPackageUpload, IPackageUploadQueue)73 IPackageUpload, IPackageUploadQueue)
74from canonical.launchpad.interfaces.packaging import IPackaging74from lp.registry.interfaces.packaging import IPackaging
75from lp.registry.interfaces.person import (75from lp.registry.interfaces.person import (
76 IPerson, ITeam, PersonVisibility)76 IPerson, ITeam, PersonVisibility)
77from lp.registry.interfaces.pillar import IPillar77from lp.registry.interfaces.pillar import IPillar
7878
=== modified file 'lib/canonical/launchpad/zcml/configure.zcml'
--- lib/canonical/launchpad/zcml/configure.zcml 2009-08-27 07:05:16 +0000
+++ lib/canonical/launchpad/zcml/configure.zcml 2009-10-16 20:36:17 +0000
@@ -29,7 +29,6 @@
29 <include file="openidconsumer.zcml" />29 <include file="openidconsumer.zcml" />
30 <include file="packagecopyrequest.zcml" />30 <include file="packagecopyrequest.zcml" />
31 <include file="packagerelationship.zcml" />31 <include file="packagerelationship.zcml" />
32 <include file="packaging.zcml" />
33 <include file="personnotification.zcml" />32 <include file="personnotification.zcml" />
34 <include file="personproduct.zcml" />33 <include file="personproduct.zcml" />
35 <include file="structuralsubscription.zcml" />34 <include file="structuralsubscription.zcml" />
3635
=== removed file 'lib/canonical/launchpad/zcml/packaging.zcml'
--- lib/canonical/launchpad/zcml/packaging.zcml 2009-07-13 18:15:02 +0000
+++ lib/canonical/launchpad/zcml/packaging.zcml 1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
1<!-- Copyright 2009 Canonical Ltd. This software is licensed under the
2 GNU Affero General Public License version 3 (see the file LICENSE).
3-->
4
5<configure
6 xmlns="http://namespaces.zope.org/zope"
7 xmlns:browser="http://namespaces.zope.org/browser"
8 xmlns:i18n="http://namespaces.zope.org/i18n"
9 xmlns:zope="http://namespaces.zope.org/zope"
10 i18n:domain="launchpad">
11
12 <!-- Packaging -->
13 <class class="canonical.launchpad.database.Packaging">
14 <allow interface="canonical.launchpad.interfaces.IPackaging" />
15 <require
16 permission="zope.Public"
17 set_schema="canonical.launchpad.interfaces.IPackaging"
18 />
19 </class>
20
21 <!-- PackagingUtil -->
22 <class class="canonical.launchpad.database.PackagingUtil">
23 <allow interface="canonical.launchpad.interfaces.IPackagingUtil" />
24 </class>
25
26 <securedutility
27 class="canonical.launchpad.database.PackagingUtil"
28 provides="canonical.launchpad.interfaces.IPackagingUtil">
29 <allow interface="canonical.launchpad.interfaces.IPackagingUtil" />
30 </securedutility>
31
32</configure>
330
=== modified file 'lib/lp/bugs/doc/distribution-upstream-bug-report.txt'
--- lib/lp/bugs/doc/distribution-upstream-bug-report.txt 2009-08-13 15:12:16 +0000
+++ lib/lp/bugs/doc/distribution-upstream-bug-report.txt 2009-10-16 20:36:17 +0000
@@ -1,19 +1,24 @@
1= Upstream Bug reports =1Upstream Bug reports
2====================
23
3For a distribution's bug tracking process to be successful, it's vital4For a distribution's bug tracking process to be successful, it's vital
4that it is able to communicate upstream bugs to the relevant upstream5that it is able to communicate upstream bugs to the relevant upstream
5project and monitor them as they change. Launchpad offers functionality6project and monitor them as they change. Launchpad offers functionality
6to allow a distribution to focus on and improve this process.7to allow a distribution to focus on and improve this process.
78
8
9 >>> from canonical.launchpad.ftests import login9 >>> from canonical.launchpad.ftests import login
10 >>> from lp.bugs.tests.bug import (10 >>> from lp.bugs.tests.bug import (
11 ... create_bug_from_strings)11 ... create_bug_from_strings)
12 >>> from canonical.launchpad.ftests import sync12 >>> from canonical.launchpad.ftests import sync
13 >>> from canonical.launchpad.interfaces import (13 >>> from lp.registry.interfaces.sourcepackagename import (
14 ... ISourcePackageNameSet, IDistributionSet, IProductSet,14 ... ISourcePackageNameSet)
15 ... IPackagingUtil, IPersonSet, PackagingType, IBugTaskSet,15 >>> from lp.registry.interfaces.distribution import IDistributionSet
16 ... IBugWatchSet, BugTaskStatus)16 >>> from lp.registry.interfaces.product import IProductSet
17 >>> from lp.registry.interfaces.packaging import (
18 ... IPackagingUtil, PackagingType)
19 >>> from lp.registry.interfaces.person import IPersonSet
20 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet, BugTaskStatus
21 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
1722
18 >>> distroset = getUtility(IDistributionSet)23 >>> distroset = getUtility(IDistributionSet)
19 >>> ubuntu = distroset.getByName('ubuntu')24 >>> ubuntu = distroset.getByName('ubuntu')
@@ -21,7 +26,8 @@
21 >>> kubuntu = distroset.getByName('kubuntu')26 >>> kubuntu = distroset.getByName('kubuntu')
2227
2328
24== The API ==29The API
30-------
2531
26IDistribution has a special API that allows you to assemble data for a32IDistribution has a special API that allows you to assemble data for a
27bug report that associates packages with upstream information linked to33bug report that associates packages with upstream information linked to
@@ -87,11 +93,11 @@
87 thunderbird None 1 1 1 193 thunderbird None 1 1 1 1
8894
89We add two new bugs to pmount in Ubuntu. From now on we'll limit the95We add two new bugs to pmount in Ubuntu. From now on we'll limit the
90results to 3 packages (as a demonstration of the API) so thunderbird will be96results to 3 packages (as a demonstration of the API) so thunderbird
91popped off the list:97will be popped off the list:
9298
93 >>> bug = create_bug_from_strings(distribution='ubuntu',99 >>> bug = create_bug_from_strings(distribution='ubuntu',
94 ... sourcepackagename='pmount', owner='name12', 100 ... sourcepackagename='pmount', owner='name12',
95 ... summary='pmount used to work', description='fix it',101 ... summary='pmount used to work', description='fix it',
96 ... status=BugTaskStatus.TRIAGED)102 ... status=BugTaskStatus.TRIAGED)
97 >>> bug = create_bug_from_strings(distribution='ubuntu',103 >>> bug = create_bug_from_strings(distribution='ubuntu',
@@ -141,7 +147,8 @@
141 mozilla-firefox firefox 1 1 1 1147 mozilla-firefox firefox 1 1 1 1
142148
143149
144== Properties of BugReportData ==150Properties of BugReportData
151---------------------------
145152
146The API listed above is based around BugReportData instances, each of153The API listed above is based around BugReportData instances, each of
147which offers a set of properties that can be used to accessed data. Each154which offers a set of properties that can be used to accessed data. Each
@@ -156,7 +163,8 @@
156 ... watched_bugs=60)163 ... watched_bugs=60)
157164
158165
159=== Percentages ===166Percentages
167...........
160168
161BugReportData offers a set of *_percentage properties.169BugReportData offers a set of *_percentage properties.
162170
@@ -179,7 +187,8 @@
179 85.714285714285708187 85.714285714285708
180188
181189
182=== Deltas ===190Deltas
191......
183192
184BugReportData also offers a set of of *_delta properties along with the193BugReportData also offers a set of of *_delta properties along with the
185*_percentage properties.194*_percentage properties.
@@ -190,8 +199,8 @@
190 >>> bug_data.triaged_bugs_delta199 >>> bug_data.triaged_bugs_delta
191 40200 40
192201
193BugReportData.upstream bugs_delta is the difference between the number of202BugReportData.upstream bugs_delta is the difference between the number
194open bugs and the number of bugs forwarded upstream.203of open bugs and the number of bugs forwarded upstream.
195204
196 >>> bug_data.upstream_bugs_delta205 >>> bug_data.upstream_bugs_delta
197 20206 20
@@ -204,12 +213,13 @@
204 10213 10
205214
206215
207=== Classes ===216Classes
217.......
208218
209Finally, BugReportData offers a set of *_class properties. These219Finally, BugReportData offers a set of *_class properties. These provide
210provide the correct CSS class to use for rendering the data in a table.220the correct CSS class to use for rendering the data in a table. They
211They return 'good' if the property that they represent is above a221return 'good' if the property that they represent is above a certain
212certain threshold or an empty string if not.222threshold or an empty string if not.
213223
214BugReportData.triaged_bugs_class returns 'good' if the224BugReportData.triaged_bugs_class returns 'good' if the
215triaged_bugs_percentage is greater than BugReportData.TRIAGED_THRESHOLD.225triaged_bugs_percentage is greater than BugReportData.TRIAGED_THRESHOLD.
@@ -295,7 +305,8 @@
295 ''305 ''
296306
297307
298== The view ==308The view
309--------
299310
300We test that the view data is constructed sanely and without any hidden311We test that the view data is constructed sanely and without any hidden
301defects. Let's set up some helpers to make it easier for us to output312defects. Let's set up some helpers to make it easier for us to output
@@ -358,9 +369,9 @@
358 NO PRODUCT369 NO PRODUCT
359 NO URL370 NO URL
360 NO URL371 NO URL
361 **linux-source-2.6.15/+bugs?search=Search&field.status_upstream=open_upstream372 **linux-source-2.6.15/+bugs?...&field.status_upstream=open_upstream
362 **linux-source-2.6.15/+bugs?search=Search&field.status_upstream=hide_upstream373 **linux-source-2.6.15/+bugs?...h&field.status_upstream=hide_upstream
363 **linux-source-2.6.15/+bugs?search=Search&field.status_upstream=pending_bugwatch374 **linux-source-2.6.15/+bugs?...&field.status_upstream=pending_bugwatch
364 --375 --
365 mozilla-firefox ubuntu hoary376 mozilla-firefox ubuntu hoary
366 firefox377 firefox
@@ -368,7 +379,7 @@
368 http://launchpad.dev/firefox/+edit379 http://launchpad.dev/firefox/+edit
369 **mozilla-firefox/+bugs?search=Search&field.status_upstream=open_upstream380 **mozilla-firefox/+bugs?search=Search&field.status_upstream=open_upstream
370 **mozilla-firefox/+bugs?search=Search&field.status_upstream=hide_upstream381 **mozilla-firefox/+bugs?search=Search&field.status_upstream=hide_upstream
371 **mozilla-firefox/+bugs?search=Search&field.status_upstream=pending_bugwatch382 **mozilla-firefox/+bugs?...&field.status_upstream=pending_bugwatch
372 --383 --
373 thunderbird ubuntu hoary384 thunderbird ubuntu hoary
374 NO PRODUCT385 NO PRODUCT
@@ -410,7 +421,8 @@
410 0 0 0 0 0.0 0.0 0.0 0 0 0421 0 0 0 0 0.0 0.0 0.0 0 0 0
411422
412423
413== Sorting the report ==424Sorting the report
425------------------
414426
415The upstream report is sortable by each of the columns displayed. We'll427The upstream report is sortable by each of the columns displayed. We'll
416demonstrate this using the Ubuntu report.428demonstrate this using the Ubuntu report.
@@ -552,6 +564,5 @@
552 bug_supervisor_name /@@/arrowBlank564 bug_supervisor_name /@@/arrowBlank
553 bugtracker_name /@@/arrowDown...565 bugtracker_name /@@/arrowDown...
554566
555PS: This page is actually browser-tested in567PS: This page is actually browser-tested in pagetests.distribution-
556pagetests.distribution-upstream-bug-report. Look there for more details.568upstream-bug-report. Look there for more details.
557
558569
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2009-10-09 17:18:38 +0000
+++ lib/lp/registry/browser/configure.zcml 2009-10-16 20:36:17 +0000
@@ -1647,7 +1647,7 @@
1647 <browser:page1647 <browser:page
1648 name="+addpackage"1648 name="+addpackage"
1649 for="lp.registry.interfaces.productseries.IProductSeries"1649 for="lp.registry.interfaces.productseries.IProductSeries"
1650 class="canonical.launchpad.browser.PackagingAddView"1650 class="lp.registry.browser.packaging.PackagingAddView"
1651 facet="overview"1651 facet="overview"
1652 permission="launchpad.Edit"1652 permission="launchpad.Edit"
1653 template="../templates/productseries-packaging.pt"/>1653 template="../templates/productseries-packaging.pt"/>
16541654
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py 2009-09-25 17:00:20 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py 2009-10-16 20:36:17 +0000
@@ -32,7 +32,7 @@
32from lp.soyuz.interfaces.distributionsourcepackagerelease import (32from lp.soyuz.interfaces.distributionsourcepackagerelease import (
33 IDistributionSourcePackageRelease)33 IDistributionSourcePackageRelease)
34from lp.soyuz.interfaces.packagediff import IPackageDiffSet34from lp.soyuz.interfaces.packagediff import IPackageDiffSet
35from canonical.launchpad.interfaces.packaging import IPackagingUtil35from lp.registry.interfaces.packaging import IPackagingUtil
36from lp.registry.interfaces.pocket import pocketsuffix36from lp.registry.interfaces.pocket import pocketsuffix
37from lp.registry.interfaces.product import IDistributionSourcePackage37from lp.registry.interfaces.product import IDistributionSourcePackage
38from lp.bugs.browser.bugtask import BugTargetTraversalMixin38from lp.bugs.browser.bugtask import BugTargetTraversalMixin
3939
=== renamed file 'lib/canonical/launchpad/browser/packaging.py' => 'lib/lp/registry/browser/packaging.py'
--- lib/canonical/launchpad/browser/packaging.py 2009-09-12 06:11:08 +0000
+++ lib/lp/registry/browser/packaging.py 2009-10-16 20:36:17 +0000
@@ -10,7 +10,7 @@
10from zope.component import getUtility10from zope.component import getUtility
1111
12from canonical.launchpad import _12from canonical.launchpad import _
13from canonical.launchpad.interfaces.packaging import (13from lp.registry.interfaces.packaging import (
14 IPackaging, IPackagingUtil)14 IPackaging, IPackagingUtil)
15from canonical.launchpad.webapp import canonical_url15from canonical.launchpad.webapp import canonical_url
16from canonical.launchpad.webapp.launchpadform import action, LaunchpadFormView16from canonical.launchpad.webapp.launchpadform import action, LaunchpadFormView
1717
=== modified file 'lib/lp/registry/browser/sourcepackage.py'
--- lib/lp/registry/browser/sourcepackage.py 2009-09-25 17:00:20 +0000
+++ lib/lp/registry/browser/sourcepackage.py 2009-10-16 20:36:17 +0000
@@ -26,7 +26,7 @@
26from lp.answers.browser.questiontarget import (26from lp.answers.browser.questiontarget import (
27 QuestionTargetFacetMixin, QuestionTargetAnswersMenu)27 QuestionTargetFacetMixin, QuestionTargetAnswersMenu)
28from lp.services.worlddata.interfaces.country import ICountry28from lp.services.worlddata.interfaces.country import ICountry
29from canonical.launchpad.interfaces.packaging import IPackaging29from lp.registry.interfaces.packaging import IPackaging
30from lp.registry.interfaces.pocket import PackagePublishingPocket30from lp.registry.interfaces.pocket import PackagePublishingPocket
31from lp.registry.interfaces.sourcepackage import ISourcePackage31from lp.registry.interfaces.sourcepackage import ISourcePackage
32from lp.translations.interfaces.potemplate import IPOTemplateSet32from lp.translations.interfaces.potemplate import IPOTemplateSet
3333
=== renamed file 'lib/canonical/launchpad/browser/tests/test_packaging.py' => 'lib/lp/registry/browser/tests/test_packaging.py'
--- lib/canonical/launchpad/browser/tests/test_packaging.py 2009-06-25 05:30:52 +0000
+++ lib/lp/registry/browser/tests/test_packaging.py 2009-10-16 20:36:17 +0000
@@ -9,8 +9,10 @@
99
10from zope.component import getUtility10from zope.component import getUtility
1111
12from canonical.launchpad.interfaces import (12from lp.registry.interfaces.distribution import IDistributionSet
13 IDistributionSet, IProductSet, ISourcePackageNameSet, IPackagingUtil)13from lp.registry.interfaces.packaging import IPackagingUtil
14from lp.registry.interfaces.product import IProductSet
15from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
14from canonical.launchpad.ftests import login, logout16from canonical.launchpad.ftests import login, logout
15from canonical.launchpad.testing.pages import setupBrowser17from canonical.launchpad.testing.pages import setupBrowser
16from canonical.testing import PageTestLayer18from canonical.testing import PageTestLayer
1719
=== modified file 'lib/lp/registry/browser/tests/test_person_view.py'
--- lib/lp/registry/browser/tests/test_person_view.py 2009-09-19 11:46:50 +0000
+++ lib/lp/registry/browser/tests/test_person_view.py 2009-10-16 20:36:17 +0000
@@ -7,7 +7,8 @@
77
8from zope.component import getUtility8from zope.component import getUtility
99
10from canonical.launchpad.interfaces import IKarmaCacheManager, NotFoundError10from canonical.launchpad.webapp.interfaces import NotFoundError
11from lp.registry.interfaces.karma import IKarmaCacheManager
11from canonical.launchpad.webapp.servers import LaunchpadTestRequest12from canonical.launchpad.webapp.servers import LaunchpadTestRequest
12from canonical.testing import LaunchpadZopelessLayer13from canonical.testing import LaunchpadZopelessLayer
13from lp.registry.browser.person import PersonView14from lp.registry.browser.person import PersonView
1415
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2009-09-10 10:27:20 +0000
+++ lib/lp/registry/configure.zcml 2009-10-16 20:36:17 +0000
@@ -1641,4 +1641,27 @@
1641 <allow1641 <allow
1642 interface="lp.registry.interfaces.mentoringoffer.IMentoringOfferSet"/>1642 interface="lp.registry.interfaces.mentoringoffer.IMentoringOfferSet"/>
1643 </securedutility>1643 </securedutility>
1644
1645 <!-- Packaging -->
1646 <class
1647 class="lp.registry.model.packaging.Packaging">
1648 <allow
1649 interface="lp.registry.interfaces.packaging.IPackaging"/>
1650 <require
1651 permission="zope.Public"
1652 set_schema="lp.registry.interfaces.packaging.IPackaging"/>
1653 </class>
1654
1655 <!-- PackagingUtil -->
1656 <class
1657 class="lp.registry.model.packaging.PackagingUtil">
1658 <allow
1659 interface="lp.registry.interfaces.packaging.IPackagingUtil"/>
1660 </class>
1661 <securedutility
1662 class="lp.registry.model.packaging.PackagingUtil"
1663 provides="lp.registry.interfaces.packaging.IPackagingUtil">
1664 <allow
1665 interface="lp.registry.interfaces.packaging.IPackagingUtil"/>
1666 </securedutility>
1644</configure>1667</configure>
16451668
=== modified file 'lib/lp/registry/doc/sourcepackage.txt'
--- lib/lp/registry/doc/sourcepackage.txt 2009-09-19 08:14:43 +0000
+++ lib/lp/registry/doc/sourcepackage.txt 2009-10-16 20:36:17 +0000
@@ -1,19 +1,22 @@
1= Source Packages =1Source Packages
22===============
3A source package is a thing from which binary packages are built, to then be3
4installed using a package management tool like apt-get or rpm. One named source4A source package is a thing from which binary packages are built, to
5package in a distro may be used to build several different named binary5then be installed using a package management tool like apt-get or rpm.
6packages, on one or more architectures. One named binary package in a distro6One named source package in a distro may be used to build several
7may have been built from more than one named source package (e.g. a different7different named binary packages, on one or more architectures. One named
8source package may have been used to build "foo" on i386 vs. "foo" on ppc.)8binary package in a distro may have been built from more than one named
99source package (e.g. a different source package may have been used to
1010build "foo" on i386 vs. "foo" on ppc.)
11== Named Source Package ==11
1212
13The are various metadata we're interested in collecting about a bundle of code13Named Source Package
14used to build binary packages for installation in a particular distro series.14--------------------
15One such thing is the name of that bundle of code. This is abstracted into a15
16separate SourcePackageName table.16The are various metadata we're interested in collecting about a bundle
17of code used to build binary packages for installation in a particular
18distro series. One such thing is the name of that bundle of code. This
19is abstracted into a separate SourcePackageName table.
1720
18Accessing source package names is done through the ISourcePackageNameSet21Accessing source package names is done through the ISourcePackageNameSet
19utility.22utility.
@@ -21,10 +24,12 @@
21The ISourcePackageNameSet utility is accessed in the usual fashion:24The ISourcePackageNameSet utility is accessed in the usual fashion:
2225
23 >>> from zope.component import getUtility26 >>> from zope.component import getUtility
24 >>> from canonical.launchpad.interfaces import ISourcePackageNameSet27 >>> from lp.registry.interfaces.sourcepackagename import (
28 ... ISourcePackageNameSet)
25 >>> sourcepackagenameset = getUtility(ISourcePackageNameSet)29 >>> sourcepackagenameset = getUtility(ISourcePackageNameSet)
2630
27To retrieve a specific source package name, use ISourcePackageNameSet.get:31To retrieve a specific source package name, use
32ISourcePackageNameSet.get:
2833
29 >>> firefox = sourcepackagenameset.get(1)34 >>> firefox = sourcepackagenameset.get(1)
30 >>> print firefox.name35 >>> print firefox.name
@@ -44,12 +49,13 @@
44 None49 None
4550
4651
47=== Latest published component ===52Latest published component
53..........................
4854
49The 'latest_published_component' attribute indicates the component where55The 'latest_published_component' attribute indicates the component where
50the package was last published.56the package was last published.
5157
52 >>> from canonical.launchpad.interfaces import IDistributionSet58 >>> from lp.registry.interfaces.distribution import IDistributionSet
53 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')59 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
54 >>> ubuntu_warty = ubuntu.getSeries('warty')60 >>> ubuntu_warty = ubuntu.getSeries('warty')
55 >>> firefox_warty = ubuntu_warty.getSourcePackage('mozilla-firefox')61 >>> firefox_warty = ubuntu_warty.getSourcePackage('mozilla-firefox')
@@ -65,6 +71,7 @@
6571
66 # Remove the security proxy to access the non-public72 # Remove the security proxy to access the non-public
67 # _getPublishingHistory method.73 # _getPublishingHistory method.
74
68 >>> from zope.security.proxy import removeSecurityProxy75 >>> from zope.security.proxy import removeSecurityProxy
69 >>> publishing_history = removeSecurityProxy(76 >>> publishing_history = removeSecurityProxy(
70 ... firefox_warty)._getPublishingHistory()77 ... firefox_warty)._getPublishingHistory()
@@ -82,6 +89,7 @@
82 # SourcePackagePublishingHistory is just a view on89 # SourcePackagePublishingHistory is just a view on
83 # SecureSourcePackagePublishingHistory with some rows removed, so need90 # SecureSourcePackagePublishingHistory with some rows removed, so need
84 # to update the SecureSourcePackagePublishingHistory table.91 # to update the SecureSourcePackagePublishingHistory table.
92
85 >>> latest_publishing = SecureSourcePackagePublishingHistory.get(93 >>> latest_publishing = SecureSourcePackagePublishingHistory.get(
86 ... publishing_history[-1].id)94 ... publishing_history[-1].id)
87 >>> universe = Component.byName('universe')95 >>> universe = Component.byName('universe')
@@ -92,6 +100,7 @@
92 >>> for release in firefox_warty.distinctreleases:100 >>> for release in firefox_warty.distinctreleases:
93 ... print release.component.name101 ... print release.component.name
94 main102 main
103
95 >>> firefox_warty.latest_published_component.name104 >>> firefox_warty.latest_published_component.name
96 u'universe'105 u'universe'
97106
@@ -131,11 +140,12 @@
131 ... pmount_hoary['0.1-1'].publishing_history[0].id)140 ... pmount_hoary['0.1-1'].publishing_history[0].id)
132 >>> secure_pub.datesuperseded is not None141 >>> secure_pub.datesuperseded is not None
133 True142 True
143
134 >>> secure_pub.dateremoved is None144 >>> secure_pub.dateremoved is None
135 True145 True
136146
137We will emulate disk-removal to ensure it will continue to be147We will emulate disk-removal to ensure it will continue to be reachable.
138reachable. See bug #179028 for further information.148See bug #179028 for further information.
139149
140 >>> from datetime import timedelta150 >>> from datetime import timedelta
141 >>> secure_pub.dateremoved = secure_pub.datesuperseded + timedelta(days=1)151 >>> secure_pub.dateremoved = secure_pub.datesuperseded + timedelta(days=1)
@@ -152,11 +162,12 @@
152 >>> len(list(pmount_hoary.distinctreleases))162 >>> len(list(pmount_hoary.distinctreleases))
153 2163 2
154164
155We will leave the pmount_0.1-1 marked as 'removed from disk' because165We will leave the pmount_0.1-1 marked as 'removed from disk' because we
156we do want it to affect the next test cases.166do want it to affect the next test cases.
157167
158168
159== Distribution Source Packages ==169Distribution Source Packages
170----------------------------
160171
161In some cases it's useful to be able to refer to a source package at a172In some cases it's useful to be able to refer to a source package at a
162distribution level, independent of any particular distroseries. For173distribution level, independent of any particular distroseries. For
@@ -167,20 +178,26 @@
167To retrieve a distribution source package, use the getSourcePackage178To retrieve a distribution source package, use the getSourcePackage
168method on a distribution:179method on a distribution:
169180
170 >>> from canonical.launchpad.interfaces import (181 >>> from lp.registry.interfaces.distribution import IDistributionSet
171 ... IDistributionSet, IDistributionSourcePackage)182 >>> from lp.registry.interfaces.distributionsourcepackage import (
183 ... IDistributionSourcePackage)
172 >>> ubuntu = getUtility(IDistributionSet).get(1)184 >>> ubuntu = getUtility(IDistributionSet).get(1)
173 >>> ubuntu_firefox = ubuntu.getSourcePackage(firefox)185 >>> ubuntu_firefox = ubuntu.getSourcePackage(firefox)
174 >>> IDistributionSourcePackage.providedBy(ubuntu_firefox)186 >>> IDistributionSourcePackage.providedBy(ubuntu_firefox)
175 True187 True
188
176 >>> print ubuntu_firefox.name189 >>> print ubuntu_firefox.name
177 mozilla-firefox190 mozilla-firefox
191
178 >>> print ubuntu_firefox.title.encode('ascii', 'backslashreplace')192 >>> print ubuntu_firefox.title.encode('ascii', 'backslashreplace')
179 \u201cmozilla-firefox\u201d package in Ubuntu193 \u201cmozilla-firefox\u201d package in Ubuntu
194
180 >>> print ubuntu_firefox.displayname195 >>> print ubuntu_firefox.displayname
181 mozilla-firefox in ubuntu196 mozilla-firefox in ubuntu
197
182 >>> ubuntu_firefox.distribution == ubuntu198 >>> ubuntu_firefox.distribution == ubuntu
183 True199 True
200
184 >>> ubuntu_firefox.sourcepackagename == firefox201 >>> ubuntu_firefox.sourcepackagename == firefox
185 True202 True
186203
@@ -192,24 +209,27 @@
192209
193 >>> ubuntu_firefox_also == ubuntu_firefox210 >>> ubuntu_firefox_also == ubuntu_firefox
194 True211 True
212
195 >>> ubuntu_firefox != debian_firefox213 >>> ubuntu_firefox != debian_firefox
196 True214 True
197215
198You can search for bugs in an IDistroSourcePackage using the216You can search for bugs in an IDistroSourcePackage using the
199.searchTasks method:217.searchTasks method:
200218
201 >>> from canonical.launchpad.interfaces import (219 >>> from lp.bugs.interfaces.bugtask import (
202 ... BugTaskSearchParams, BugTaskStatus)220 ... BugTaskSearchParams, BugTaskStatus)
203 >>> params = BugTaskSearchParams(221 >>> params = BugTaskSearchParams(
204 ... status=BugTaskStatus.NEW, user=None)222 ... status=BugTaskStatus.NEW, user=None)
205 >>> tasks = ubuntu_firefox.searchTasks(params)223 >>> tasks = ubuntu_firefox.searchTasks(params)
206 >>> tasks.count()224 >>> tasks.count()
207 1225 1
226
208 >>> tasks[0].id227 >>> tasks[0].id
209 17228 17
210229
211230
212== Packaging ==231Packaging
232---------
213233
214Distribution packages are linked to upstream productseries through the234Distribution packages are linked to upstream productseries through the
215packaging process. Here we test the code that links all of those.235packaging process. Here we test the code that links all of those.
@@ -230,7 +250,8 @@
230 >>> sid = DistroSeries.get(8)250 >>> sid = DistroSeries.get(8)
231 >>> g2k5 = DistroSeries.get(9)251 >>> g2k5 = DistroSeries.get(9)
232252
233Now let's make sure that we can see a productseries for a source package.253Now let's make sure that we can see a productseries for a source
254package.
234255
235 >>> from lp.registry.model.sourcepackage import SourcePackage256 >>> from lp.registry.model.sourcepackage import SourcePackage
236 >>> sp = SourcePackage(sourcepackagename=firefox, distroseries=hoary)257 >>> sp = SourcePackage(sourcepackagename=firefox, distroseries=hoary)
@@ -239,9 +260,9 @@
239260
240Now we make sure there is no Packaging data for a52dec in hoary.261Now we make sure there is no Packaging data for a52dec in hoary.
241262
242 >>> from canonical.launchpad.database import PackagingUtil263 >>> from lp.registry.model.packaging import PackagingUtil
243 >>> a52decsp = SourcePackage(sourcepackagename=a52dec,264 >>> a52decsp = SourcePackage(sourcepackagename=a52dec,
244 ... distroseries=hoary) 265 ... distroseries=hoary)
245 >>> a52decsp.productseries.name266 >>> a52decsp.productseries.name
246 u'trunk'267 u'trunk'
247268
@@ -265,9 +286,10 @@
265 >>> a52decsp.productseries.product.name286 >>> a52decsp.productseries.product.name
266 u'a52dec'287 u'a52dec'
267288
268Similarly, we should be able to get the packaging information from a parent289Similarly, we should be able to get the packaging information from a
269distroseries, on the basis that a derivative is highly unlikely to change290parent distroseries, on the basis that a derivative is highly unlikely
270the packaging drastically without changing the name of the package.291to change the packaging drastically without changing the name of the
292package.
271293
272First, show there is no packging data for a52dec in g2k5:294First, show there is no packging data for a52dec in g2k5:
273295
@@ -275,7 +297,7 @@
275 ... productseries=a52decsp.productseries,297 ... productseries=a52decsp.productseries,
276 ... sourcepackagename=a52dec,298 ... sourcepackagename=a52dec,
277 ... distroseries=g2k5)299 ... distroseries=g2k5)
278 False 300 False
279301
280Now verify we still get a product for that source package302Now verify we still get a product for that source package
281303
@@ -286,7 +308,7 @@
286And if we want to link that productseries to a source package in that308And if we want to link that productseries to a source package in that
287distroseries309distroseries
288310
289 >>> from canonical.launchpad.interfaces import PackagingType311 >>> from lp.registry.interfaces.packaging import PackagingType
290 >>> from lp.registry.model.person import Person312 >>> from lp.registry.model.person import Person
291 >>> foobar = Person.byName('name16')313 >>> foobar = Person.byName('name16')
292 >>> PackagingUtil().createPackaging(314 >>> PackagingUtil().createPackaging(
@@ -314,10 +336,9 @@
314 ... distroseries=g2k5)336 ... distroseries=g2k5)
315 False337 False
316338
317Linkified changelogs are available through SourcePackageReleaseView:339Linkified changelogs are available through SourcePackageReleaseView: XXX
318XXX julian 2007-09-17340julian 2007-09-17 This is duplicating the page test. Instead it should
319This is duplicating the page test. Instead it should be more like the bug341be more like the bug number linkification just below.
320number linkification just below.
321342
322 >>> from zope.component import queryMultiAdapter343 >>> from zope.component import queryMultiAdapter
323 >>> from zope.publisher.browser import TestRequest344 >>> from zope.publisher.browser import TestRequest
@@ -338,13 +359,13 @@
338 * Fix debian (Debian #2000)359 * Fix debian (Debian #2000)
339 * Fix warty (Warty Ubuntu #1)360 * Fix warty (Warty Ubuntu #1)
340 <BLANKLINE>361 <BLANKLINE>
341 -- Sample Person &lt;email address hidden&gt; Tue, 7 Feb 2006 12:10:08 +0300362 -- Sample Person &lt;email address hidden&gt; ... Feb 2006 12:10:08 +0300
342 <BLANKLINE>363 <BLANKLINE>
343 <BLANKLINE>364 <BLANKLINE>
344365
345The view will linkify bug numbers of the format "LP: #number" in the changelog366The view will linkify bug numbers of the format "LP: #number" in the
346if number is a valid bug ID (also see Soyuz page tests367changelog if number is a valid bug ID (also see Soyuz page tests 24
34724-sourcepackage-changelog.txt). The changelog() method calls a method368-sourcepackage-changelog.txt). The changelog() method calls a method
348_linkify_bug_numbers() to do this.369_linkify_bug_numbers() to do this.
349370
350Zero or more spaces may appear between the ":" and the "#".371Zero or more spaces may appear between the ":" and the "#".
@@ -378,7 +399,8 @@
378 u'lp: <a href="/bugs/10" title="another test bug">#10</a>'399 u'lp: <a href="/bugs/10" title="another test bug">#10</a>'
379400
380401
381== Comparing Sourcepackages ==402Comparing Sourcepackages
403------------------------
382404
383Lastly, note that sourcepackages know how to compare to each other:405Lastly, note that sourcepackages know how to compare to each other:
384406
@@ -391,8 +413,10 @@
391413
392 >>> hoary_firefox_one == hoary_firefox_two414 >>> hoary_firefox_one == hoary_firefox_two
393 True415 True
416
394 >>> hoary_firefox_one != warty_firefox417 >>> hoary_firefox_one != warty_firefox
395 True418 True
419
396 >>> hoary_firefox_one == warty_firefox420 >>> hoary_firefox_one == warty_firefox
397 False421 False
398422
@@ -400,6 +424,7 @@
400424
401 >>> hash(hoary_firefox_one) == hash(hoary_firefox_two)425 >>> hash(hoary_firefox_one) == hash(hoary_firefox_two)
402 True426 True
427
403 >>> hash(hoary_firefox_one) != hash(warty_firefox)428 >>> hash(hoary_firefox_one) != hash(warty_firefox)
404 True429 True
405430
@@ -408,26 +433,30 @@
408 >>> a_map[warty_firefox] = 'warty'433 >>> a_map[warty_firefox] = 'warty'
409 >>> a_map[hoary_firefox_two]434 >>> a_map[hoary_firefox_two]
410 'hoary'435 'hoary'
436
411 >>> a_map[warty_firefox]437 >>> a_map[warty_firefox]
412 'warty'438 'warty'
413439
414440
415== Direct Packagings ==441Direct Packagings
442-----------------
416443
417The direct packaging returns the IPackaging related to the source444The direct packaging returns the IPackaging related to the source
418package.445package.
419446
420 >>> print sp.direct_packaging447 >>> print sp.direct_packaging
421 None448 None
449
422 >>> print hoary_firefox_one.direct_packaging.productseries.title450 >>> print hoary_firefox_one.direct_packaging.productseries.title
423 Mozilla Firefox 1.0 series451 Mozilla Firefox 1.0 series
452
424 >>> print warty_firefox.direct_packaging.productseries.title453 >>> print warty_firefox.direct_packaging.productseries.title
425 Mozilla Firefox trunk series454 Mozilla Firefox trunk series
426455
427If multiple product series link to a sourcepackage, direct_packaging456If multiple product series link to a sourcepackage, direct_packaging
428returns the last packaging added:457returns the last packaging added:
429458
430 >>> from canonical.launchpad.interfaces import IProductSet459 >>> from lp.registry.interfaces.product import IProductSet
431 >>> firefox_product = getUtility(IProductSet).getByName('firefox')460 >>> firefox_product = getUtility(IProductSet).getByName('firefox')
432 >>> firefox_trunk = firefox_product.getSeries('trunk')461 >>> firefox_trunk = firefox_product.getSeries('trunk')
433 >>> PackagingUtil().createPackaging(462 >>> PackagingUtil().createPackaging(
@@ -440,13 +469,14 @@
440 Mozilla Firefox trunk series469 Mozilla Firefox trunk series
441470
442471
443== Release History ==472Release History
473---------------
444474
445The distinct release history for a SourcePackage is obtained via475The distinct release history for a SourcePackage is obtained via
446'distinctreleases' property.476'distinctreleases' property.
447477
448We will use `SoyuzTestPublisher` for creating source releases in478We will use `SoyuzTestPublisher` for creating source releases in Ubuntu
449Ubuntu warty and hoary series.479warty and hoary series.
450480
451 >>> from lp.soyuz.tests.test_publishing import (481 >>> from lp.soyuz.tests.test_publishing import (
452 ... SoyuzTestPublisher)482 ... SoyuzTestPublisher)
@@ -465,8 +495,8 @@
465495
466 >>> login(ANONYMOUS)496 >>> login(ANONYMOUS)
467497
468Warty, hoary and grumpy SourcePackages only consider their498Warty, hoary and grumpy SourcePackages only consider their corresponding
469corresponding versions, their history is isolated by series.499versions, their history is isolated by series.
470500
471 >>> def print_releases(sourcepackage):501 >>> def print_releases(sourcepackage):
472 ... releases = sourcepackage.distinctreleases502 ... releases = sourcepackage.distinctreleases
@@ -490,8 +520,8 @@
490 No releases available520 No releases available
491521
492The SourcePackage history can overlap if releases are copied across522The SourcePackage history can overlap if releases are copied across
493distroseries. The 'test-source - 1.0' is copied from warty to hoary523distroseries. The 'test-source - 1.0' is copied from warty to hoary and
494and is present in the history for both.524is present in the history for both.
495525
496 >>> login('foo.bar@canonical.com')526 >>> login('foo.bar@canonical.com')
497 >>> copied_source = warty_source.copyTo(527 >>> copied_source = warty_source.copyTo(
@@ -506,7 +536,8 @@
506 test-source - 1.0536 test-source - 1.0
507537
508We will create new source releases in warty and verify the ResultSet538We will create new source releases in warty and verify the ResultSet
509returned from 'distinctreleases' is ordered by descending source version.539returned from 'distinctreleases' is ordered by descending source
540version.
510541
511 >>> login('foo.bar@canonical.com')542 >>> login('foo.bar@canonical.com')
512543
@@ -524,7 +555,8 @@
524 test-source - 0.9555 test-source - 0.9
525556
526557
527== Interface implementation ==558Interface implementation
559------------------------
528560
529SourcePackage implements IHasTranslationImports interface:561SourcePackage implements IHasTranslationImports interface:
530562
@@ -533,5 +565,8 @@
533 ... IHasTranslationImports)565 ... IHasTranslationImports)
534 >>> IHasTranslationImports.providedBy(warty_firefox)566 >>> IHasTranslationImports.providedBy(warty_firefox)
535 True567 True
568
536 >>> verifyObject(IHasTranslationImports, warty_firefox)569 >>> verifyObject(IHasTranslationImports, warty_firefox)
537 True570 True
571
572
538573
=== renamed file 'lib/canonical/launchpad/interfaces/packaging.py' => 'lib/lp/registry/interfaces/packaging.py'
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2009-09-09 11:28:03 +0000
+++ lib/lp/registry/model/distribution.py 2009-10-16 20:36:17 +0000
@@ -90,7 +90,7 @@
90from canonical.launchpad.interfaces.launchpad import (90from canonical.launchpad.interfaces.launchpad import (
91 IHasIcon, IHasLogo, IHasMugshot, ILaunchpadCelebrities, ILaunchpadUsage)91 IHasIcon, IHasLogo, IHasMugshot, ILaunchpadCelebrities, ILaunchpadUsage)
92from lp.soyuz.interfaces.queue import PackageUploadStatus92from lp.soyuz.interfaces.queue import PackageUploadStatus
93from canonical.launchpad.interfaces.packaging import PackagingType93from lp.registry.interfaces.packaging import PackagingType
94from lp.registry.interfaces.pillar import IPillarNameSet94from lp.registry.interfaces.pillar import IPillarNameSet
95from lp.soyuz.interfaces.publishing import (95from lp.soyuz.interfaces.publishing import (
96 active_publishing_status, PackagePublishingStatus)96 active_publishing_status, PackagePublishingStatus)
9797
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2009-09-09 11:28:03 +0000
+++ lib/lp/registry/model/distroseries.py 2009-10-16 20:36:17 +0000
@@ -39,7 +39,7 @@
39from lp.translations.model.pofiletranslator import (39from lp.translations.model.pofiletranslator import (
40 POFileTranslator)40 POFileTranslator)
41from lp.translations.model.pofile import POFile41from lp.translations.model.pofile import POFile
42from canonical.launchpad.interfaces import IStore42from canonical.launchpad.interfaces.lpstorm import IStore
43from lp.soyuz.adapters.packagelocation import PackageLocation43from lp.soyuz.adapters.packagelocation import PackageLocation
44from lp.soyuz.model.binarypackagename import BinaryPackageName44from lp.soyuz.model.binarypackagename import BinaryPackageName
45from lp.soyuz.model.binarypackagerelease import (45from lp.soyuz.model.binarypackagerelease import (
@@ -66,7 +66,7 @@
66from lp.registry.model.milestone import (66from lp.registry.model.milestone import (
67 HasMilestonesMixin, Milestone)67 HasMilestonesMixin, Milestone)
68from lp.soyuz.model.packagecloner import clone_packages68from lp.soyuz.model.packagecloner import clone_packages
69from canonical.launchpad.database.packaging import Packaging69from lp.registry.model.packaging import Packaging
70from lp.registry.model.person import Person70from lp.registry.model.person import Person
71from canonical.launchpad.database.librarian import LibraryFileAlias71from canonical.launchpad.database.librarian import LibraryFileAlias
72from lp.translations.model.potemplate import (72from lp.translations.model.potemplate import (
7373
=== renamed file 'lib/canonical/launchpad/database/packaging.py' => 'lib/lp/registry/model/packaging.py'
--- lib/canonical/launchpad/database/packaging.py 2009-06-25 05:30:52 +0000
+++ lib/lp/registry/model/packaging.py 2009-10-16 20:36:17 +0000
@@ -14,8 +14,8 @@
14from canonical.database.datetimecol import UtcDateTimeCol14from canonical.database.datetimecol import UtcDateTimeCol
15from canonical.database.enumcol import EnumCol15from canonical.database.enumcol import EnumCol
16from canonical.database.sqlbase import SQLBase16from canonical.database.sqlbase import SQLBase
17from canonical.launchpad.interfaces import (17from lp.registry.interfaces.packaging import (
18 PackagingType, IPackaging, IPackagingUtil)18 IPackaging, IPackagingUtil, PackagingType)
19from lp.registry.interfaces.person import validate_public_person19from lp.registry.interfaces.person import validate_public_person
2020
2121
2222
=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py 2009-10-07 22:30:34 +0000
+++ lib/lp/registry/model/product.py 2009-10-16 20:36:17 +0000
@@ -32,7 +32,7 @@
32from canonical.database.datetimecol import UtcDateTimeCol32from canonical.database.datetimecol import UtcDateTimeCol
33from canonical.database.enumcol import EnumCol33from canonical.database.enumcol import EnumCol
34from canonical.database.sqlbase import quote, SQLBase, sqlvalues34from canonical.database.sqlbase import quote, SQLBase, sqlvalues
35from canonical.launchpad.interfaces import IStore35from canonical.launchpad.interfaces.lpstorm import IStore
36from lp.code.model.branchvisibilitypolicy import (36from lp.code.model.branchvisibilitypolicy import (
37 BranchVisibilityPolicyMixin)37 BranchVisibilityPolicyMixin)
38from lp.code.model.hasbranches import HasBranchesMixin, HasMergeProposalsMixin38from lp.code.model.hasbranches import HasBranchesMixin, HasMergeProposalsMixin
@@ -57,7 +57,7 @@
57from lp.registry.interfaces.person import (57from lp.registry.interfaces.person import (
58 validate_person_not_private_membership, validate_public_person)58 validate_person_not_private_membership, validate_public_person)
59from lp.registry.model.announcement import MakesAnnouncements59from lp.registry.model.announcement import MakesAnnouncements
60from canonical.launchpad.database.packaging import Packaging60from lp.registry.model.packaging import Packaging
61from lp.registry.model.pillar import HasAliasMixin61from lp.registry.model.pillar import HasAliasMixin
62from lp.registry.model.person import Person62from lp.registry.model.person import Person
63from lp.registry.model.productlicense import ProductLicense63from lp.registry.model.productlicense import ProductLicense
6464
=== modified file 'lib/lp/registry/model/productseries.py'
--- lib/lp/registry/model/productseries.py 2009-10-06 17:45:46 +0000
+++ lib/lp/registry/model/productseries.py 2009-10-16 20:36:17 +0000
@@ -33,7 +33,7 @@
33from lp.services.worlddata.model.language import Language33from lp.services.worlddata.model.language import Language
34from lp.registry.model.milestone import (34from lp.registry.model.milestone import (
35 HasMilestonesMixin, Milestone)35 HasMilestonesMixin, Milestone)
36from canonical.launchpad.database.packaging import Packaging36from lp.registry.model.packaging import Packaging
37from lp.registry.interfaces.person import (37from lp.registry.interfaces.person import (
38 validate_person_not_private_membership)38 validate_person_not_private_membership)
39from lp.translations.model.pofile import POFile39from lp.translations.model.pofile import POFile
@@ -53,7 +53,7 @@
53from lp.registry.interfaces.distroseries import DistroSeriesStatus53from lp.registry.interfaces.distroseries import DistroSeriesStatus
54from lp.registry.model.distroseries import SeriesMixin54from lp.registry.model.distroseries import SeriesMixin
55from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities55from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
56from canonical.launchpad.interfaces.packaging import PackagingType56from lp.registry.interfaces.packaging import PackagingType
57from lp.translations.interfaces.potemplate import IHasTranslationTemplates57from lp.translations.interfaces.potemplate import IHasTranslationTemplates
58from lp.blueprints.interfaces.specification import (58from lp.blueprints.interfaces.specification import (
59 SpecificationDefinitionStatus, SpecificationFilter,59 SpecificationDefinitionStatus, SpecificationFilter,
6060
=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py 2009-09-30 18:15:41 +0000
+++ lib/lp/registry/model/sourcepackage.py 2009-10-16 20:36:17 +0000
@@ -32,11 +32,11 @@
32 DistributionSourcePackageRelease)32 DistributionSourcePackageRelease)
33from lp.soyuz.model.distroseriessourcepackagerelease import (33from lp.soyuz.model.distroseriessourcepackagerelease import (
34 DistroSeriesSourcePackageRelease)34 DistroSeriesSourcePackageRelease)
35from canonical.launchpad.database.packaging import Packaging35from lp.registry.model.packaging import Packaging
36from lp.translations.model.potemplate import (36from lp.translations.model.potemplate import (
37 HasTranslationTemplatesMixin,37 HasTranslationTemplatesMixin,
38 POTemplate)38 POTemplate)
39from canonical.launchpad.interfaces import IStore39from canonical.launchpad.interfaces.lpstorm import IStore
40from lp.soyuz.model.publishing import (40from lp.soyuz.model.publishing import (
41 SourcePackagePublishingHistory)41 SourcePackagePublishingHistory)
42from lp.answers.model.question import (42from lp.answers.model.question import (
@@ -50,7 +50,7 @@
50from canonical.launchpad.helpers import shortlist50from canonical.launchpad.helpers import shortlist
51from lp.soyuz.interfaces.build import BuildStatus51from lp.soyuz.interfaces.build import BuildStatus
52from lp.soyuz.interfaces.buildrecords import IHasBuildRecords52from lp.soyuz.interfaces.buildrecords import IHasBuildRecords
53from canonical.launchpad.interfaces.packaging import PackagingType53from lp.registry.interfaces.packaging import PackagingType
54from lp.translations.interfaces.potemplate import IHasTranslationTemplates54from lp.translations.interfaces.potemplate import IHasTranslationTemplates
55from lp.registry.interfaces.pocket import PackagePublishingPocket55from lp.registry.interfaces.pocket import PackagePublishingPocket
56from lp.soyuz.interfaces.publishing import PackagePublishingStatus56from lp.soyuz.interfaces.publishing import PackagePublishingStatus
5757
=== added directory 'lib/lp/registry/stories/packaging'
=== renamed file 'lib/canonical/launchpad/pagetests/packaging/xx-sourcepackage-packaging.txt' => 'lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt'
=== renamed file 'lib/canonical/launchpad/pagetests/packaging/xx-ubuntu-pkging.txt' => 'lib/lp/registry/stories/packaging/xx-ubuntu-pkging.txt'
=== renamed file 'lib/canonical/launchpad/tests/test_packaging.py' => 'lib/lp/registry/tests/test_packaging.py'
--- lib/canonical/launchpad/tests/test_packaging.py 2009-06-25 05:30:52 +0000
+++ lib/lp/registry/tests/test_packaging.py 2009-10-16 20:36:17 +0000
@@ -9,8 +9,10 @@
99
10from zope.component import getUtility10from zope.component import getUtility
1111
12from canonical.launchpad.interfaces import (12from lp.registry.interfaces.distribution import IDistributionSet
13 IDistributionSet, IProductSet, ISourcePackageNameSet, IPackagingUtil)13from lp.registry.interfaces.packaging import IPackagingUtil
14from lp.registry.interfaces.product import IProductSet
15from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
14from canonical.launchpad.ftests import login16from canonical.launchpad.ftests import login
15from canonical.testing import LaunchpadFunctionalLayer17from canonical.testing import LaunchpadFunctionalLayer
1618
1719
=== modified file 'utilities/migrater/migrater.py'
--- utilities/migrater/migrater.py 2009-09-17 17:29:33 +0000
+++ utilities/migrater/migrater.py 2009-10-16 20:36:17 +0000
@@ -33,6 +33,7 @@
33 svc='services',33 svc='services',
34 tes='testing',34 tes='testing',
35 tra='translations',35 tra='translations',
36 pkg='registry',
36 )37 )
3738
38RENAME_MAP = dict(39RENAME_MAP = dict(
@@ -108,6 +109,7 @@
108109
109COLLIDED = []110COLLIDED = []
110111
112
111def move_it(old_path, new_path):113def move_it(old_path, new_path):
112 """Move a versioned file without colliding with another file."""114 """Move a versioned file without colliding with another file."""
113 # Move the file and fix the imports. LBYL.115 # Move the file and fix the imports. LBYL.
@@ -233,8 +235,8 @@
233 # All unit tests except to browser unit tests move to the app235 # All unit tests except to browser unit tests move to the app
234 # tests dir.236 # tests dir.
235 new_path = os.sep.join(237 new_path = os.sep.join(
236 path_part for path_part in path.split(os.sep)238 path_part for path_part in new_path.split(os.sep)
237 if path_path not in unsupported_dirs)239 if path_part not in unsupported_dirs)
238 # Create new_path's directory if it doesn't exist yet.240 # Create new_path's directory if it doesn't exist yet.
239 try:241 try:
240 test_dir, dummy = os.path.split(new_path)242 test_dir, dummy = os.path.split(new_path)
@@ -586,7 +588,7 @@
586 path, file_name = os.path.split(to_path)588 path, file_name = os.path.split(to_path)
587 spew(" to_path = %s", to_path)589 spew(" to_path = %s", to_path)
588 new_path_to_dir = os.path.join(NEW_TOP, app_name, path)590 new_path_to_dir = os.path.join(NEW_TOP, app_name, path)
589 new_path_to_fn = os.path.join(NEW_TOP, app_name, to_path)591 new_path_to_fn = os.path.join(NEW_TOP, app_name, to_path)
590 # Special cases.592 # Special cases.
591 if set(fpath.split(os.sep)) & TEST_PATHS:593 if set(fpath.split(os.sep)) & TEST_PATHS:
592 handle_test(full_path, new_path_to_fn)594 handle_test(full_path, new_path_to_fn)