Merge lp:~rvb/launchpad/sync-bug-827608-populate-ancestor-redone into lp:launchpad

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 14021
Proposed branch: lp:~rvb/launchpad/sync-bug-827608-populate-ancestor-redone
Merge into: lp:launchpad
Prerequisite: lp:~rvb/launchpad/sync-bug-827608-spph-creator-code-redone
Diff against target: 32 lines (+10/-1)
2 files modified
lib/lp/soyuz/model/publishing.py (+1/-1)
lib/lp/soyuz/tests/test_publishing.py (+9/-0)
To merge this branch: bzr merge lp:~rvb/launchpad/sync-bug-827608-populate-ancestor-redone
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+76689@code.launchpad.net

Commit message

Populate the SourcePackagePublishingHistory's ancestor column when the new spph is created by being copied over.

Description of the change

This is exactly the same MP as the one that has been approved: https://code.launchpad.net/~rvb/launchpad/sync-bug-827608-populate-ancestor/+merge/74737. This was reverted as part of a 4 branches revert ... and only the 2 last branches should have been reverted.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

Rubber-stamped after conversation in #launchpad-redsquad.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/model/publishing.py'
2--- lib/lp/soyuz/model/publishing.py 2011-09-23 08:00:31 +0000
3+++ lib/lp/soyuz/model/publishing.py 2011-09-23 08:00:31 +0000
4@@ -814,7 +814,7 @@
5 component,
6 section,
7 pocket,
8- ancestor=None,
9+ ancestor=self,
10 create_dsd_job=create_dsd_job,
11 creator=creator)
12
13
14=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
15--- lib/lp/soyuz/tests/test_publishing.py 2011-09-23 08:00:31 +0000
16+++ lib/lp/soyuz/tests/test_publishing.py 2011-09-23 08:00:31 +0000
17@@ -1012,6 +1012,15 @@
18 # Section has no default so it comes from the old publication.
19 self.assertEqual(spph.section, copy.section)
20
21+ def test_copyTo_sets_ancestor(self):
22+ # SPPH's ancestor get's populated when a spph is copied over.
23+ target_archive = self.factory.makeArchive()
24+ spph = self.factory.makeSourcePackagePublishingHistory()
25+ copy = spph.copyTo(
26+ spph.distroseries, spph.pocket, target_archive)
27+
28+ self.assertEqual(spph, copy.ancestor)
29+
30
31 class BuildRecordCreationTests(TestNativePublishingBase):
32 """Test the creation of build records."""