← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/dsspr-cleanup into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/dsspr-cleanup into lp:launchpad.

Commit message:
Rip out DistroSeriesSourcePackageRelease model code, and a few unused methods and views.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/dsspr-cleanup/+merge/241227

Rip out DistroSeriesSourcePackageRelease model code, and a few unused methods and views.
-- 
https://code.launchpad.net/~wgrant/launchpad/dsspr-cleanup/+merge/241227
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/dsspr-cleanup into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt'
--- lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt	2012-03-27 13:38:04 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt	2014-11-10 01:39:28 +0000
@@ -31,11 +31,11 @@
     >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
     >>> hoary = ubuntu.getSeries('hoary')
 
-    >>> ed_sp = hoary.getSourcePackage('ed')
-    >>> ed_dsspr = ed_sp['0.2-20']
-    >>> ed_dsspr.publishing_history.count()
+    >>> ed_dsp = ubuntu.getSourcePackage('ed')
+    >>> ed_dspr = ed_dsp.getVersion('0.2-20')
+    >>> ed_dspr.publishing_history.count()
     1
-    >>> ed_pub = ed_dsspr.publishing_history[0]
+    >>> ed_pub = ed_dspr.publishing_history[0]
 
     >>> ed_pub.sourcepackagerelease.title
     u'ed - 0.2-20'
@@ -83,10 +83,10 @@
 auto-accepted (i.e, published as PENDING), it should be immediately
 available via the package stack:
 
-    >>> ed21_dsspr = ed_sp['0.2-21']
-    >>> ed21_dsspr.publishing_history.count()
+    >>> ed21_dspr = ed_dsp.getVersion('0.2-21')
+    >>> ed21_dspr.publishing_history.count()
     1
-    >>> ed21_pub = ed21_dsspr.publishing_history[0]
+    >>> ed21_pub = ed21_dspr.publishing_history[0]
 
     >>> ed21_pub.sourcepackagerelease.title
     u'ed - 0.2-21'

=== modified file 'lib/lp/registry/doc/distroseries.txt'
--- lib/lp/registry/doc/distroseries.txt	2014-11-09 08:35:54 +0000
+++ lib/lp/registry/doc/distroseries.txt	2014-11-10 01:39:28 +0000
@@ -380,9 +380,9 @@
 
     >>> bumpy_firefox_sp = bumpy.getSourcePackage('mozilla-firefox')
 
-Check the content IDRSPR binaries & builds attributes:
+Check the content IDSPR binaries & builds attributes:
 
-'binaries' should be inherited from parent release.
+getBinariesForSeries() should be inherited from parent release.
 
     >>> bumpy_firefox_sp.currentrelease.getBinariesForSeries(bumpy).count()
     3
@@ -393,20 +393,6 @@
     26 mozilla-firefox-0.9 The Warty Warthog Release for hppa (hppa)
     12 mozilla-firefox-0.9 The Warty Warthog Release for i386 (386)
 
-
-'builds' should be empty since it was built in parent (warty), not in this
-distroseries (bumby.
-
-    >>> bumpy_firefox_dsspr = bumpy.getSourcePackageRelease(
-    ...     bumpy_firefox_sp.currentrelease.sourcepackagerelease)
-    >>> len(bumpy_firefox_dsspr.builds)
-    0
-
-the SPR returns all build records for it.
-
-    >>> bumpy_firefox_dsspr.sourcepackagerelease.builds.count()
-    4
-
 The new series also has the same packaging links as its parent series.
 
     >>> for packaging in warty.packagings:
@@ -526,110 +512,6 @@
     chex
     bjorn
 
-DistroSeries can build meta objects for packages
-------------------------------------------------
-
-    >>> from lp.registry.interfaces.sourcepackage import ISourcePackage
-    >>> from lp.soyuz.interfaces.distroseriesbinarypackage import (
-    ...     IDistroSeriesBinaryPackage,
-    ...     )
-    >>> from lp.soyuz.interfaces.distroseriessourcepackagerelease import (
-    ...     IDistroSeriesSourcePackageRelease,
-    ...     )
-
-    >>> pmount_src_name = SourcePackageName.byName('pmount')
-    >>> pmount_source = hoary.getSourcePackage(pmount_src_name)
-    >>> ISourcePackage.providedBy(pmount_source)
-    True
-
-    >>> from lp.soyuz.model.binarypackagename import (
-    ...                                       BinaryPackageName)
-    >>> pmount_bin_name = BinaryPackageName.byName('pmount')
-    >>> pmount_drbp = hoary.getBinaryPackage(pmount_bin_name)
-    >>> IDistroSeriesBinaryPackage.providedBy(pmount_drbp)
-    True
-    >>> len(pmount_drbp.current_publishings)
-    3
-
-    >>> from lp.soyuz.model.sourcepackagerelease import (
-    ...                                           SourcePackageRelease)
-    >>> pmount_rel = SourcePackageRelease.selectOneBy(
-    ...     sourcepackagenameID=pmount_src_name.id, version='0.1-1')
-    >>> pmount_rel.sourcepackagename.name
-    u'pmount'
-
-    >>> pmount_srcrel = hoary.getSourcePackageRelease(pmount_rel)
-    >>> IDistroSeriesSourcePackageRelease.providedBy(pmount_srcrel)
-    True
-
-Check some properties of DRSPR meta class
-
-Entire publishing history:
-
-    >>> pmount_srcrel.publishing_history.count()
-    1
-
-The changesfile attribute contains the package changelog. It is provided as
-an ILibraryFileAlias:
-
-    >>> firefox_dspr = warty.getSourcePackage('mozilla-firefox').currentrelease
-    >>> firefox_srcrel = warty.getSourcePackageRelease(
-    ...     firefox_dspr.sourcepackagerelease)
-    >>> print firefox_srcrel.title
-    "mozilla-firefox" 0.9 source package in The Warty Warthog Release
-
-    >>> firefox_srcrel.changesfile
-    <LibraryFileAlias at ...>
-
-If the package changelog is not available, that attribute is None:
-
-    >>> netapplet_dspr = hoary.getSourcePackage('netapplet').currentrelease
-    >>> netapplet_srcrel = hoary.getSourcePackageRelease(
-    ...     netapplet_dspr.sourcepackagerelease)
-    >>> netapplet_srcrel.changesfile is None
-    True
-
-Perform `post publication` override:
-
-    >>> new_section = getUtility(ISectionSet)['base']
-
-    >>> override = netapplet_srcrel.publishing_history.first().changeOverride(
-    ...     new_section=new_section)
-
-    >>> override.section == new_section
-    True
-
-    >>> print override.status.name
-    PENDING
-
-    >>> netapplet_srcrel.publishing_history.count()
-    2
-
-Override information about 'pmount' is pending publication:
-
-    >>> overridden = netapplet_srcrel.publishing_history.first()
-    >>> print overridden.status.name
-    PENDING
-
-    >>> print overridden.section.name
-    base
-
-Supersede previous netapplet publication:
-
-    >>> last_published = netapplet_srcrel.publishing_history[1]
-    >>> last_published.supersede()
-    >>> flush_database_updates()
-
-    >>> netapplet_srcrel.publishing_history.count()
-    2
-
-    >>> print last_published.status.name
-    SUPERSEDED
-
-    >>> from lp.services.database.sqlbase import get_transaction_timestamp
-    >>> last_published.datesuperseded == get_transaction_timestamp()
-    True
-
 
 SourcePackagePublishingHistory
 ------------------------------
@@ -650,7 +532,7 @@
     ...     PackagePublishingPocket.RELEASE, component_main,
     ...     warty.main_archive)
     >>> spphs.count()
-    5
+    6
     >>> for name in sorted(set(
     ...         pkgpub.sourcepackagerelease.sourcepackagename.name
     ...         for pkgpub in spphs)):
@@ -659,6 +541,7 @@
     evolution
     libstdc++
     linux-source-2.6.15
+    netapplet
     pmount
     >>> hoary.getSourcePackagePublishing(
     ...     PackagePublishingPocket.RELEASE, component_multiverse,
@@ -1021,13 +904,13 @@
 ---------------
 
 IDistroSeries provides the 'getLatestUpload' method which returns a
-list of the last 5 (five) IDistroSeriesSourcePackageRelease (IDRSPR)
+list of the last 5 (five) IDistributionSourcePackageRelease (IDSPR)
 uploaded and published in its context.
 
     >>> warty = ubuntu['warty']
     >>> latest_uploads = warty.getLatestUploads()
 
-Each element is an IDistroSeriesSourcePackageRelease instance:
+Each element is an IDistributionSourcePackageRelease instance:
 
     >>> for upload in latest_uploads:
     ...     print upload.title

=== modified file 'lib/lp/registry/doc/sourcepackage.txt'
--- lib/lp/registry/doc/sourcepackage.txt	2012-12-26 01:32:19 +0000
+++ lib/lp/registry/doc/sourcepackage.txt	2014-11-10 01:39:28 +0000
@@ -165,19 +165,14 @@
     "pmount" 0.1-1 source package in Ubuntu SUPERSEDED
     "pmount" 0.1-2 source package in Ubuntu PUBLISHED
 
-    >>> print pmount_hoary['0.1-1'].title
-    "pmount" 0.1-1 source package in The Hoary Hedgehog Release
-
-    >>> print pmount_hoary['0.1-2'].title
-    "pmount" 0.1-2 source package in The Hoary Hedgehog Release
-
     >>> len(list(pmount_hoary.distinctreleases))
     2
 
 'pmount_0.1-1' in hoary is SUPERSEDED but not yet 'removed from disk'.
 
-    >>> pub = SourcePackagePublishingHistory.get(
-    ...     pmount_hoary['0.1-1'].publishing_history[0].id)
+    >>> pub = removeSecurityProxy(ubuntu.main_archive.getPublishedSources(
+    ...     distroseries=ubuntu['hoary'], name=u'pmount',
+    ...     version=u'0.1-1').one())
     >>> pub.datesuperseded is not None
     True
     >>> pub.dateremoved is None
@@ -194,9 +189,6 @@
     "pmount" 0.1-1 source package in Ubuntu SUPERSEDED
     "pmount" 0.1-2 source package in Ubuntu PUBLISHED
 
-    >>> print pmount_hoary['0.1-1'].title
-    "pmount" 0.1-1 source package in The Hoary Hedgehog Release
-
     >>> len(list(pmount_hoary.distinctreleases))
     2
 
@@ -297,15 +289,15 @@
     >>> from lp.services.webapp.servers import LaunchpadTestRequest
     >>> mock_form = {}
     >>> request = LaunchpadTestRequest(form=mock_form)
-    >>> sp = SourcePackage(sourcepackagename=pmount, distroseries=hoary)
-    >>> spr = sp['0.1-2']
-    >>> spr_view = queryMultiAdapter((spr, request), name="+changelog")
-    >>> print spr_view.changelog_entry
+    >>> dsp = ubuntu.getSourcePackage(pmount)
+    >>> dspr = dsp.getVersion('0.1-2')
+    >>> dspr_view = queryMultiAdapter((dspr, request), name="+changelog")
+    >>> print dspr_view.changelog_entry
     This is a placeholder changelog for pmount 0.1-2
 
-    >>> spr = sp['0.1-1']
-    >>> spr_view = queryMultiAdapter((spr, request), name="+changelog")
-    >>> print spr_view.changelog_entry
+    >>> dspr = dsp.getVersion('0.1-1')
+    >>> dspr_view = queryMultiAdapter((dspr, request), name="+changelog")
+    >>> print dspr_view.changelog_entry
     pmount (0.1-1) hoary; urgency=low
     <BLANKLINE>
      * Fix description (Malone #1)
@@ -366,6 +358,7 @@
 The direct packaging returns the IPackaging related to the source
 package.
 
+    >>> sp = hoary.getSourcePackage(pmount)
     >>> print sp.direct_packaging
     None
 

=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py	2014-11-09 08:35:54 +0000
+++ lib/lp/registry/interfaces/distroseries.py	2014-11-10 01:39:28 +0000
@@ -572,12 +572,6 @@
         binary package may not be published in the distro series.
         """
 
-    def getSourcePackageRelease(sourcepackagerelease):
-        """Return a IDistroSeriesSourcePackageRelease
-
-        sourcepackagerelease is an ISourcePackageRelease.
-        """
-
     def getCurrentSourceReleases(source_package_names):
         """Get the current release of a list of source packages.
 

=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
--- lib/lp/registry/interfaces/sourcepackage.py	2013-01-07 02:40:55 +0000
+++ lib/lp/registry/interfaces/sourcepackage.py	2014-11-10 01:39:28 +0000
@@ -170,10 +170,6 @@
     owner = Attribute(
         "The owner of the distroseries for this source package.")
 
-    def __getitem__(version):
-        """Return the source package release with the given version in this
-        distro series, or None."""
-
     def __hash__():
         """Sourcepackage hash method.
 

=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py	2014-11-09 08:35:54 +0000
+++ lib/lp/registry/model/distroseries.py	2014-11-10 01:39:28 +0000
@@ -152,9 +152,6 @@
     )
 from lp.soyuz.model.distroseriesbinarypackage import DistroSeriesBinaryPackage
 from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache
-from lp.soyuz.model.distroseriessourcepackagerelease import (
-    DistroSeriesSourcePackageRelease,
-    )
 from lp.soyuz.model.files import (
     BinaryPackageFile,
     SourcePackageReleaseFile,
@@ -881,10 +878,6 @@
                 return None
         return DistroSeriesBinaryPackage(self, name)
 
-    def getSourcePackageRelease(self, sourcepackagerelease):
-        """See `IDistroSeries`."""
-        return DistroSeriesSourcePackageRelease(self, sourcepackagerelease)
-
     def getCurrentSourceReleases(self, source_package_names):
         """See `IDistroSeries`."""
         return getUtility(IDistroSeriesSet).getCurrentSourceReleases(

=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py	2014-11-09 01:48:36 +0000
+++ lib/lp/registry/model/sourcepackage.py	2014-11-10 01:39:28 +0000
@@ -79,9 +79,6 @@
 from lp.soyuz.model.distributionsourcepackagerelease import (
     DistributionSourcePackageRelease,
     )
-from lp.soyuz.model.distroseriessourcepackagerelease import (
-    DistroSeriesSourcePackageRelease,
-    )
 from lp.soyuz.model.publishing import SourcePackagePublishingHistory
 from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
 from lp.translations.model.hastranslationimports import (
@@ -284,15 +281,6 @@
             [self.sourcepackagename])
         return releases.get(self)
 
-    def __getitem__(self, version):
-        """See `ISourcePackage`."""
-        latest_package = self._getFirstPublishingHistory(version=version)
-        if latest_package:
-            return DistroSeriesSourcePackageRelease(
-                    self.distroseries, latest_package.sourcepackagerelease)
-        else:
-            return None
-
     @property
     def path(self):
         """See `ISourcePackage`."""

=== modified file 'lib/lp/registry/tests/test_distroseries.py'
--- lib/lp/registry/tests/test_distroseries.py	2014-11-09 07:21:24 +0000
+++ lib/lp/registry/tests/test_distroseries.py	2014-11-10 01:39:28 +0000
@@ -98,7 +98,7 @@
     def test_return_value(self):
         # getCurrentSourceReleases() returns a dict. The corresponding
         # source package is used as the key, with
-        # a DistroSeriesSourcePackageRelease as the values.
+        # a DistributionSourcePackageRelease as the values.
         self.publisher.getPubSource(version='0.9')
         releases = self.target.getCurrentSourceReleases(
             [self.published_package.sourcepackagename])

=== modified file 'lib/lp/soyuz/browser/configure.zcml'
--- lib/lp/soyuz/browser/configure.zcml	2014-11-09 22:19:29 +0000
+++ lib/lp/soyuz/browser/configure.zcml	2014-11-10 01:39:28 +0000
@@ -20,9 +20,6 @@
             permission="zope.Public"
             class="lp.soyuz.browser.publishing.BinaryPublishingRecordView">
             <browser:page
-                name="+listing-detailed"
-                template="../templates/binarypackagepublishinghistory-listing-detailed.pt"/>
-            <browser:page
                 name="+listing-summary"
                 template="../templates/binarypackagepublishinghistory-listing-summary.pt"/>
             <browser:page
@@ -109,9 +106,6 @@
                 name="+listing-compact"
                 template="../templates/sourcepackagepublishinghistory-listing-compact.pt"/>
             <browser:page
-                name="+listing-detailed"
-                template="../templates/sourcepackagepublishinghistory-listing-detailed.pt"/>
-            <browser:page
                 name="+listing-summary"
                 template="../templates/sourcepackagepublishinghistory-listing-summary.pt"/>
             <browser:page

=== modified file 'lib/lp/soyuz/browser/tests/sourcepackage-views.txt'
--- lib/lp/soyuz/browser/tests/sourcepackage-views.txt	2012-12-26 01:32:19 +0000
+++ lib/lp/soyuz/browser/tests/sourcepackage-views.txt	2014-11-10 01:39:28 +0000
@@ -22,12 +22,12 @@
 Check the consistency of a handy structure containing the organized
 published history of a sourcepackage. It should contain a list of
 dictionaries containing all supported pockets as key 'pocketdetails'
-and a list of packages represented by IDistroSeriesSourcePackageRelease
+and a list of packages represented by IDistributionSourcePackageRelease
 as 'packages', as:
 
   [
    {'pocketdetails': PackagePublishingPocket,
-    'packages': [IDistroSeriesSourcePackagerelease, ...]}
+    'packages': [IDistributionSourcePackageRelease, ...]}
    ...
   ]
 
@@ -97,7 +97,7 @@
 Ensure we have fixed bug 31039, by properly escape the
 sourcepackagename before passing to regexp.
 
-  >>> libc = hoary.getSourcePackage('libstdc++')['b8p']
+  >>> libc = ubuntu.getSourcePackage('libstdc++').getVersion('b8p')
   >>> libc_view = queryMultiAdapter((libc, request), name="+changelog")
   >>> print libc_view.changelog_entry
   libstdc++ (9.9-1) hoary; urgency=high

=== modified file 'lib/lp/soyuz/configure.zcml'
--- lib/lp/soyuz/configure.zcml	2014-07-23 09:35:34 +0000
+++ lib/lp/soyuz/configure.zcml	2014-11-10 01:39:28 +0000
@@ -292,14 +292,6 @@
             interface="lp.soyuz.interfaces.archivedependency.IArchiveDependency"/>
     </class>
 
-    <!-- DistroSeriesSourcePackageRelease -->
-
-    <class
-        class="lp.soyuz.model.distroseriessourcepackagerelease.DistroSeriesSourcePackageRelease">
-        <allow
-            interface="lp.soyuz.interfaces.distroseriessourcepackagerelease.IDistroSeriesSourcePackageRelease"/>
-    </class>
-
     <!-- PackageDiff -->
 
     <class

=== modified file 'lib/lp/soyuz/doc/package-meta-classes.txt'
--- lib/lp/soyuz/doc/package-meta-classes.txt	2014-11-09 07:21:24 +0000
+++ lib/lp/soyuz/doc/package-meta-classes.txt	2014-11-10 01:39:28 +0000
@@ -8,12 +8,9 @@
  >>> from lp.registry.model.sourcepackagename import SourcePackageName
  >>> from lp.soyuz.model.distributionsourcepackagerelease import (
  ...     DistributionSourcePackageRelease)
- >>> from lp.soyuz.model.distroseriessourcepackagerelease import (
- ...     DistroSeriesSourcePackageRelease)
  >>> from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
 
  >>> from lp.soyuz.interfaces.distributionsourcepackagerelease import IDistributionSourcePackageRelease
- >>> from lp.soyuz.interfaces.distroseriessourcepackagerelease import IDistroSeriesSourcePackageRelease
 
 
 DistributionSourcePackage class is tested in:
@@ -44,25 +41,9 @@
  u'pmount 0.1-1'
 
 
-Combining DistroSeries and SourcePackageRelease:
-
- >>> distroseries = distribution['hoary']
-
- >>> drspr = DistroSeriesSourcePackageRelease(distroseries,
- ...                                           sourcepackagerelease)
- >>> verifyObject(IDistroSeriesSourcePackageRelease, drspr)
- True
-
- >>> print drspr.displayname
- pmount 0.1-1
-
- >>> print drspr.title
- "pmount" 0.1-1 source package in The Hoary Hedgehog Release
-
-== Querying builds for DistributionSPR and DistroSeriesSPR ==
-
-Both the DistroSeriesSourcePackageRelease class and the
-DistributionSourcePackageRelease have a builds() method which
+== Querying builds for DistributionSourcePackageRelease ==
+
+DistributionSourcePackageRelease objects have a builds() method which
 returns all the builds for the source package that have been published
 in a main archive.
 
@@ -96,12 +77,9 @@
     >>> binary_pkg_pub_history = test_publisher.publishBinaryInArchive(
     ...     binary_pkg_release, ubuntutest.main_archive)
 
-Next we create our DistroSeriesSourcePackageRelease and our
-DistributionSourcePackageRelease
+Next we create our DistributionSourcePackageRelease.
 
     >>> breezy_autotest = ubuntutest['breezy-autotest']
-    >>> breezytest_dsspr_foo = DistroSeriesSourcePackageRelease(
-    ...     breezy_autotest, source_pub.sourcepackagerelease)
     >>> ubuntutest_dspr_foo = DistributionSourcePackageRelease(
     ...     ubuntutest, source_pub.sourcepackagerelease)
 
@@ -114,8 +92,6 @@
 
 Now we can query the builds:
 
-    >>> print_builds(breezytest_dsspr_foo.builds)
-    foo in Primary Archive for Ubuntu Test
     >>> print_builds(ubuntutest_dspr_foo.builds)
     foo in Primary Archive for Ubuntu Test
 
@@ -131,9 +107,6 @@
     >>> binary_pkg_pub_history = test_publisher.publishBinaryInArchive(
     ...     binary_pkg_release, partner_archive)
 
-    >>> print_builds(breezytest_dsspr_foo.builds)
-    foo in Partner Archive for Ubuntu Test
-    foo in Primary Archive for Ubuntu Test
     >>> print_builds(ubuntutest_dspr_foo.builds)
     foo in Partner Archive for Ubuntu Test
     foo in Primary Archive for Ubuntu Test
@@ -151,15 +124,11 @@
     ...     build, 'bar-bin')
     >>> binary_pkg_pub_history = test_publisher.publishBinaryInArchive(
     ...     binary_pkg_release, cprov.archive)
-    >>> breezytest_dsspr_bar = DistroSeriesSourcePackageRelease(
-    ...     breezy_autotest, source_pub.sourcepackagerelease)
     >>> ubuntutest_dspr_bar = DistributionSourcePackageRelease(
     ...     ubuntutest, source_pub.sourcepackagerelease)
 
 the build will not be returned.
 
-    >>> print_builds(breezytest_dsspr_bar.builds)
-
     >>> print_builds(ubuntutest_dspr_bar.builds)
 
 But if the package is copied into the main archive (and the binary published
@@ -170,8 +139,6 @@
     >>> binary_pkg_pub_history = test_publisher.publishBinaryInArchive(
     ...     binary_pkg_release, ubuntutest.main_archive)
 
-    >>> print_builds(breezytest_dsspr_bar.builds)
-    bar in PPA for Celso Providelo
     >>> print_builds(ubuntutest_dspr_bar.builds)
     bar in PPA for Celso Providelo
 

=== modified file 'lib/lp/soyuz/interfaces/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/interfaces/distributionsourcepackagerelease.py	2014-11-09 01:48:36 +0000
+++ lib/lp/soyuz/interfaces/distributionsourcepackagerelease.py	2014-11-10 01:39:28 +0000
@@ -34,19 +34,11 @@
     publishing_history = Attribute("Return a list of publishing "
         "records for this source package release in this distribution.")
 
-    current_publishings = Attribute("Return a list of the places where "
-        "this sourcepackage release is currently published in this "
-        "distribution. The result is a list of "
-        "DistroSeriesSourcePackageRelease objects.")
-
     builds = Attribute("The builds we have for this sourcepackage release "
         "specifically in this distribution. Note that binaries could "
         "be inherited from a parent distribution, not necessarily built "
         "here, but must be published in a main archive.")
 
-    binary_package_names = Attribute("The binary package names of "
-        "packages that were built from this source package release.")
-
     sample_binary_packages = Attribute("A single binary package of each "
         "named package produced from this source package in this "
         "distribution. The are each of form DistroSeriesBinaryPackage.")

=== removed file 'lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py'
--- lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py	2014-11-09 07:21:24 +0000
+++ lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py	1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
-# Copyright 2009 Canonical Ltd.  This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Source package release in Distribution Series interfaces."""
-
-__metaclass__ = type
-
-__all__ = [
-    'IDistroSeriesSourcePackageRelease',
-    ]
-
-from zope.interface import Attribute
-from zope.schema import Object
-
-from lp import _
-from lp.services.librarian.interfaces import ILibraryFileAlias
-from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease
-
-
-class IDistroSeriesSourcePackageRelease(ISourcePackageRelease):
-    """This is a SourcePackageRelease-In-A-DistroSeries. It represents a
-    real source package release that has been uploaded to a distroseries.
-
-    You can tell if it is still in the queue, and in which queue. You can
-    ask it the dates of various events in its history in this
-    distroseries. You can also ask it what pocket it is published in, if
-    it has been published. Or which version superseded it, if it has been
-    superseded.
-    """
-
-    distroseries = Attribute("The distro series.")
-    sourcepackage = Attribute("The distribution series source package.")
-    distributionsourcepackagerelease = Attribute(
-        "The distribution source package release.")
-    sourcepackagerelease = Attribute("The source package release.")
-
-    name = Attribute("The source package name as text")
-    displayname = Attribute("Display name for this package.")
-    title = Attribute("Title for this package.")
-    distribution = Attribute("The distribution.")
-    pocket = Attribute("The pocket in which this release is published, "
-        "or None if it is not currently published.")
-
-    publishing_history = Attribute("Return a list of publishing "
-        "records for this source package release in this series "
-        "of the distribution.")
-
-    builds = Attribute("The builds we have for this sourcepackage release "
-        "specifically in this distroseries. Note that binaries could "
-        "be inherited from a parent distribution, not necessarily built "
-        "here, but must be published in a main archive.")
-
-    version = Attribute("The version of the source package release.")
-
-    changesfile = Object(
-        title=_("Correspondent changesfile."), schema=ILibraryFileAlias,
-        readonly=True)

=== modified file 'lib/lp/soyuz/interfaces/sourcepackagerelease.py'
--- lib/lp/soyuz/interfaces/sourcepackagerelease.py	2014-10-31 08:05:34 +0000
+++ lib/lp/soyuz/interfaces/sourcepackagerelease.py	2014-11-10 01:39:28 +0000
@@ -125,9 +125,6 @@
         "A boolean that indicates whether this package still needs to be "
         "built (on any architecture)")
 
-    current_publishings = Attribute("A list of the current places where "
-        "this source package is published, in the form of a list of "
-        "DistroSeriesSourcePackageReleases.")
     published_archives = Attribute("A set of all the archives that this "
         "source package is published in.")
     upload_archive = Attribute(

=== modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/model/distributionsourcepackagerelease.py	2014-11-09 11:48:45 +0000
+++ lib/lp/soyuz/model/distributionsourcepackagerelease.py	2014-11-10 01:39:28 +0000
@@ -23,7 +23,6 @@
 from zope.interface import implements
 
 from lp.services.database.decoratedresultset import DecoratedResultSet
-from lp.services.database.sqlbase import sqlvalues
 from lp.soyuz.interfaces.distributionsourcepackagerelease import (
     IDistributionSourcePackageRelease,
     )
@@ -123,19 +122,6 @@
                 Desc(BinaryPackageBuild.id))
 
     @property
-    def binary_package_names(self):
-        """See IDistributionSourcePackageRelease."""
-        return BinaryPackageName.select("""
-            BinaryPackageName.id =
-                BinaryPackageRelease.binarypackagename AND
-            BinaryPackageRelease.build = BinaryPackageBuild.id AND
-            BinaryPackageBuild.source_package_release = %s
-            """ % sqlvalues(self.sourcepackagerelease.id),
-            clauseTables=['BinaryPackageRelease', 'BinaryPackageBuild'],
-            orderBy='name',
-            distinct=True)
-
-    @property
     def sample_binary_packages(self):
         """See IDistributionSourcePackageRelease."""
         #avoid circular imports.

=== removed file 'lib/lp/soyuz/model/distroseriessourcepackagerelease.py'
--- lib/lp/soyuz/model/distroseriessourcepackagerelease.py	2014-11-09 07:21:24 +0000
+++ lib/lp/soyuz/model/distroseriessourcepackagerelease.py	1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
-# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Classes to represent source package releases in a distribution series."""
-
-__metaclass__ = type
-
-__all__ = [
-    'DistroSeriesSourcePackageRelease',
-    ]
-
-from lazr.delegates import delegates
-from storm.expr import Desc
-from storm.store import Store
-from zope.interface import implements
-
-from lp.registry.interfaces.distroseries import IDistroSeries
-from lp.soyuz.interfaces.distroseriessourcepackagerelease import (
-    IDistroSeriesSourcePackageRelease,
-    )
-from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease
-from lp.soyuz.model.publishing import SourcePackagePublishingHistory
-
-
-class DistroSeriesSourcePackageRelease:
-    """This is a "Magic SourcePackageRelease in Distro Release". It is not
-    an SQLObject but instead it describes the behaviour of a specific
-    release of the package in the distroseries."""
-
-    implements(IDistroSeriesSourcePackageRelease)
-
-    delegates(ISourcePackageRelease, context='sourcepackagerelease')
-
-    def __init__(self, distroseries, sourcepackagerelease):
-        assert IDistroSeries.providedBy(distroseries)
-        self.distroseries = distroseries
-        assert ISourcePackageRelease.providedBy(sourcepackagerelease)
-        self.sourcepackagerelease = sourcepackagerelease
-
-    @property
-    def distribution(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return self.distroseries.distribution
-
-    @property
-    def sourcepackage(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return self.distroseries.getSourcePackage(self.sourcepackagename)
-
-    @property
-    def distributionsourcepackagerelease(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return self.distribution.getSourcePackageRelease(
-            self.sourcepackagerelease)
-
-    @property
-    def displayname(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return '%s %s' % (self.name, self.version)
-
-    @property
-    def title(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return '"%s" %s source package in %s' % (
-            self.name, self.version, self.distroseries.title)
-
-    @property
-    def version(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return self.sourcepackagerelease.version
-
-    @property
-    def pocket(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        currpub = self.current_publishing_record
-        if currpub is None:
-            return None
-        return currpub.pocket
-
-    @property
-    def section(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        currpub = self.current_publishing_record
-        if currpub is None:
-            return None
-        return currpub.section
-
-    @property
-    def component(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        currpub = self.current_publishing_record
-        if currpub is None:
-            return None
-        return currpub.component
-
-# XXX cprov 20071026: heavy queries should be moved near to the related
-# content classes in order to be better maintained.
-    @property
-    def builds(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        # Find all the builds for the distribution and then filter them
-        # for the current distroseries. We do this rather than separate
-        # storm query because DSSPR will be removed later as part of the
-        # planned package refactor.
-
-        # Import DistributionSourcePackageRelease here to avoid circular
-        # imports (and imported directly from database to avoid long line)
-        from lp.soyuz.model.distributionsourcepackagerelease import (
-            DistributionSourcePackageRelease)
-
-        distro_builds = DistributionSourcePackageRelease(
-            self.distroseries.distribution,
-            self.sourcepackagerelease).builds
-
-        return (
-            [build for build in distro_builds
-             if build.distro_arch_series.distroseries == self.distroseries])
-
-    @property
-    def files(self):
-        """See `ISourcePackageRelease`."""
-        return self.sourcepackagerelease.files
-
-    @property
-    def changesfile(self):
-        """See `IDistroSeriesSourcePackageRelease`."""
-        return self.sourcepackagerelease.upload_changesfile
-
-#
-# Publishing lookup methods.
-#
-
-    @property
-    def publishing_history(self):
-        """See `IDistroSeriesSourcePackage`."""
-        res = Store.of(self.distroseries).find(
-            SourcePackagePublishingHistory,
-            SourcePackagePublishingHistory.archiveID.is_in(
-                self.distroseries.distribution.all_distro_archive_ids),
-            SourcePackagePublishingHistory.distroseries == self.distroseries,
-            SourcePackagePublishingHistory.sourcepackagerelease ==
-                self.sourcepackagerelease)
-        return res.order_by(
-            Desc(SourcePackagePublishingHistory.datecreated),
-            Desc(SourcePackagePublishingHistory.id))
-
-    @property
-    def current_publishing_record(self):
-        """An internal property used by methods of this class to know where
-        this release is or was published.
-        """
-        return self.publishing_history.first()

=== modified file 'lib/lp/soyuz/model/sourcepackagerelease.py'
--- lib/lp/soyuz/model/sourcepackagerelease.py	2014-10-31 10:34:51 +0000
+++ lib/lp/soyuz/model/sourcepackagerelease.py	2014-11-10 01:39:28 +0000
@@ -225,14 +225,6 @@
     def title(self):
         return '%s - %s' % (self.sourcepackagename.name, self.version)
 
-    @property
-    def current_publishings(self):
-        """See ISourcePackageRelease."""
-        from lp.soyuz.model.distroseriessourcepackagerelease import (
-            DistroSeriesSourcePackageRelease)
-        return [DistroSeriesSourcePackageRelease(pub.distroseries, self)
-                for pub in self.publishings]
-
     @cachedproperty
     def published_archives(self):
         archives = set(

=== removed file 'lib/lp/soyuz/templates/binarypackagepublishinghistory-listing-detailed.pt'
--- lib/lp/soyuz/templates/binarypackagepublishinghistory-listing-detailed.pt	2009-07-17 17:59:07 +0000
+++ lib/lp/soyuz/templates/binarypackagepublishinghistory-listing-detailed.pt	1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
-<div class="boardComment">
-
-  <tal:XXX condition="nothing">
-    # XXX: cprov 20071018 bug=153885
-    # The template should be kept in sync with its respective source
-    # replacement (sourcepackagepublishinghistory-listing-detailed.pt).
-    # In the future we should be able to refactor both in a single
-    # template macro, see bug #153885.
-  </tal:XXX>
-
-  <div class="boardCommentDetails">
-    <strong>
-      <a tal:content="context/distroarchseriesbinarypackagerelease/version"
-         tal:attributes="href context/distroarchseriesbinarypackagerelease/fmt:url"
-      >2.0.39</a>
-    </strong>
-    <table>
-      <tbody>
-        <tr>
-         <td>
-           <strong tal:content="context/status/name">PUBLISHED</strong>:
-           <a tal:attributes="href context/distroarchseries/fmt:url"
-              tal:content="context/distroarchseries/displayname">warty i386</a>
-           pocket <strong tal:content="context/pocket/title">Release</strong>
-           in component <strong tal:content="context/component/name">main</strong>
-           and section <strong tal:content="context/section/name">x11</strong>
-         </td>
-        </tr>
-      </tbody>
-    </table>
-  </div>
-
-  <div class="boardCommentBody">
-     <tal:block replace="structure context/@@+record-details" />
-  </div>
-
-</div>

=== removed file 'lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-detailed.pt'
--- lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-detailed.pt	2014-11-09 09:01:26 +0000
+++ lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-detailed.pt	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-<tal:root
-  xmlns:tal="http://xml.zope.org/namespaces/tal";
-  xmlns:metal="http://xml.zope.org/namespaces/metal";
-  xmlns:i18n="http://xml.zope.org/namespaces/i18n";
-  omit-tag="">
-
-<div class="boardComment">
-
-  <tal:XXX condition="nothing">
-   # XXX: cprov 20071018 bug=153885
-   #   The template should be kept in sync with its respective binary
-   #   replacement (binarypackagepublishinghistory-listing-detailed.pt).
-   #   In the future we should be able to refactor both in a single
-   #   template macro.
-  </tal:XXX>
-
-  <div class="boardCommentDetails">
-    <strong>
-      <a tal:content="context/sourcepackagerelease/version"
-         tal:attributes="href context/meta_distributionsourcepackagerelease/fmt:url"
-      >2.0.39</a>
-    </strong>
-    <table>
-      <tbody>
-        <tr>
-         <td>
-           <strong tal:content="context/status/name">PUBLISHED</strong>:
-           <a tal:attributes="href context/meta_sourcepackage/fmt:url"
-              tal:content="context/distroseries/displayname">warty</a>
-           pocket <strong tal:content="context/pocket/title">Release</strong>
-           in component <strong tal:content="context/component/name">main</strong>
-           and section <strong tal:content="context/section/name">x11</strong>
-         </td>
-        </tr>
-      </tbody>
-    </table>
-  </div>
-
-  <div class="boardCommentBody">
-     <tal:block replace="structure context/@@+record-details" />
-  </div>
-
-</div>
-</tal:root>


Follow ups