← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad/135610-duplicated-ancestry-2 into lp:launchpad/devel

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/135610-duplicated-ancestry-2 into lp:launchpad/devel with lp:~jelmer/launchpad/135610-duplicated-ancestry as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code


William pointed out that the assertion I added in my branch can fail in some situations that aren't actually a problem. 

When publishing new records the publisher will actually set the new record the PUBLISHED before it sets the old record to SUPERSEDED. Because of this we've decided to simply skip the assertion.
-- 
https://code.launchpad.net/~jelmer/launchpad/135610-duplicated-ancestry-2/+merge/38521
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/135610-duplicated-ancestry-2 into lp:launchpad/devel.
=== modified file 'lib/lp/archiveuploader/nascentuploadfile.py'
--- lib/lp/archiveuploader/nascentuploadfile.py	2010-10-15 10:03:58 +0000
+++ lib/lp/archiveuploader/nascentuploadfile.py	2010-10-15 10:04:11 +0000
@@ -803,11 +803,6 @@
                 "Unable to find source package %s/%s in %s" % (
                 self.source_name, self.source_version, distroseries.name))
 
-        # There can only be one matching published source package.
-        published_spphs = [
-            spph for spph in spphs
-            if spph.status == PackagePublishingStatus.PUBLISHED]
-        assert len(published_spphs) <= 1, "Duplicated ancestry"
         return spphs[0].sourcepackagerelease
 
     def verifySourcePackageRelease(self, sourcepackagerelease):

=== modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py'
--- lib/lp/archiveuploader/tests/test_nascentuploadfile.py	2010-10-15 10:03:58 +0000
+++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py	2010-10-15 10:04:11 +0000
@@ -455,32 +455,3 @@
         uploadfile.parseControl(control)
         self.assertEquals(
             spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease())
-
-    def test_findSourcePackageRelease_duplicated_ancestry(self):
-        # findSourcePackageRelease errors out if there are multiple
-        # published SourcePackageReleases, as this should never
-        # be possible.
-        das = self.factory.makeDistroArchSeries(
-            distroseries=self.policy.distroseries, architecturetag="i386")
-        build = self.factory.makeBinaryPackageBuild(
-            distroarchseries=das,
-            archive=self.policy.archive)
-        uploadfile = self.createDebBinaryUploadFile(
-            "foo_0.42_i386.deb", "main/python", "unknown", "mypkg", "0.42",
-            None)
-        spn = self.factory.makeSourcePackageName("foo")
-        spph1 = self.factory.makeSourcePackagePublishingHistory(
-            sourcepackagename=spn,
-            distroseries=self.policy.distroseries,
-            version="0.42", archive=self.policy.archive,
-            status=PackagePublishingStatus.PUBLISHED)
-        spph2 = self.factory.makeSourcePackagePublishingHistory(
-            sourcepackagename=spn,
-            distroseries=self.policy.distroseries,
-            version="0.42", archive=self.policy.archive,
-            status=PackagePublishingStatus.PUBLISHED)
-        control = self.getBaseControl()
-        control["Source"] = "foo"
-        uploadfile.parseControl(control)
-        self.assertRaises(
-            AssertionError, uploadfile.findSourcePackageRelease)