launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #01329
[Merge] lp:~stevenk/launchpad/cp-ids-enabled-dases into lp:~launchpad-pqm/launchpad/production-devel
Steve Kowalik has proposed merging lp:~stevenk/launchpad/cp-ids-enabled-dases into lp:~launchpad-pqm/launchpad/production-devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
This branch is a cherry pick of the following change:
https://code.edge.launchpad.net/~stevenk/launchpad/db-ids-enabled-dases/+merge/36823
This branch makes a small change to InitialiseDistroSeries to not copy disabled DistroArchSerieses (!) when we copy them into the child distroseries. I've added a test, and as a bonus, it doesn't use sampledata.
--
https://code.launchpad.net/~stevenk/launchpad/cp-ids-enabled-dases/+merge/37255
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/cp-ids-enabled-dases into lp:~launchpad-pqm/launchpad/production-devel.
=== modified file 'lib/lp/soyuz/scripts/initialise_distroseries.py'
--- lib/lp/soyuz/scripts/initialise_distroseries.py 2010-09-09 17:02:33 +0000
+++ lib/lp/soyuz/scripts/initialise_distroseries.py 2010-10-01 13:54:20 +0000
@@ -133,7 +133,8 @@
INSERT INTO DistroArchSeries
(distroseries, processorfamily, architecturetag, owner, official)
SELECT %s, processorfamily, architecturetag, %s, official
- FROM DistroArchSeries WHERE distroseries = %s %s
+ FROM DistroArchSeries WHERE distroseries = %s
+ AND enabled = TRUE %s
""" % (sqlvalues(self.distroseries, self.distroseries.owner,
self.parent) + (include,)))
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-09-09 17:02:33 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py 2010-10-01 13:54:20 +0000
@@ -240,6 +240,27 @@
foobuntu.main_archive, 'pmount', uploader,
distroseries=foobuntu))
+ def test_do_not_copy_disabled_dases(self):
+ # DASes that are disabled in the parent will not be copied
+ i386 = self.factory.makeProcessorFamily()
+ ppc = self.factory.makeProcessorFamily()
+ parent = self.factory.makeDistroSeries()
+ i386_das = self.factory.makeDistroArchSeries(
+ distroseries=parent, processorfamily=i386)
+ ppc_das = self.factory.makeDistroArchSeries(
+ distroseries=parent, processorfamily=ppc)
+ ppc_das.enabled = False
+ parent.nominatedarchindep = i386_das
+ foobuntu = self._create_distroseries(parent)
+ ids = InitialiseDistroSeries(foobuntu)
+ ids.check()
+ ids.initialise()
+ das = list(IStore(DistroArchSeries).find(
+ DistroArchSeries, distroseries = foobuntu))
+ self.assertEqual(len(das), 1)
+ self.assertEqual(
+ das[0].architecturetag, i386_das.architecturetag)
+
def test_script(self):
# Do an end-to-end test using the command-line tool
uploader = self.factory.makePerson()