launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15334
[Merge] lp:~cjwatson/launchpad/testfix-delete-unmodifiable-suite into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/testfix-delete-unmodifiable-suite into lp:launchpad.
Commit message:
Make sure distroseries are marked as DEVELOPMENT before trying to delete packages from them.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/testfix-delete-unmodifiable-suite/+merge/152807
Test fix for https://code.launchpad.net/~cjwatson/launchpad/delete-unmodifiable-suite/+merge/152529 - make sure distroseries are marked as DEVELOPMENT before trying to delete packages from them.
--
https://code.launchpad.net/~cjwatson/launchpad/testfix-delete-unmodifiable-suite/+merge/152807
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/testfix-delete-unmodifiable-suite into lp:launchpad.
=== modified file 'lib/lp/soyuz/doc/publishing.txt'
--- lib/lp/soyuz/doc/publishing.txt 2013-01-22 02:06:59 +0000
+++ lib/lp/soyuz/doc/publishing.txt 2013-03-12 01:20:31 +0000
@@ -379,7 +379,9 @@
removal_comment argument.
>>> from zope.component import getUtility
+ >>> from lp.registry.interfaces.series import SeriesStatus
>>> mark = getUtility(IPersonSet).getByName('mark')
+ >>> spph.distroseries.status = SeriesStatus.DEVELOPMENT
>>> spph.requestDeletion(mark, "testing deletion")
Inspecting the modified record shows it's ready for domination:
@@ -414,6 +416,8 @@
>>> modified_spph.scheduleddeletiondate == transaction_timestamp
True
+ >>> spph.distroseries.status = SeriesStatus.CURRENT
+
Copying and published binarypackages lookup
===========================================
@@ -475,7 +479,6 @@
'distroseries' and 'archive' will be constant.
- >>> from lp.registry.interfaces.series import SeriesStatus
>>> distroseries = source.distroseries
>>> distroseries.status = SeriesStatus.CURRENT
>>> archive = source.archive
=== modified file 'utilities/soyuz-sampledata-setup.py'
--- utilities/soyuz-sampledata-setup.py 2013-01-07 02:40:55 +0000
+++ utilities/soyuz-sampledata-setup.py 2013-03-12 01:20:31 +0000
@@ -128,6 +128,13 @@
def retire_distro_archives(distribution, culprit):
"""Retire all items in `distribution`'s archives."""
+
+ # Temporarily mark all `DistroSeries` as in-development so that we can
+ # delete publications from them. We're about to delete the series
+ # anyway.
+ for series in distribution.series:
+ series.status = SeriesStatus.DEVELOPMENT
+
for archive in distribution.all_distro_archives:
retire_active_publishing_histories(
archive.getPublishedSources, culprit)