launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04904
[Merge] lp:~rvb/launchpad/sync-bug-827608-populate-ancestor into lp:launchpad/db-devel
Raphaël Victor Badin has proposed merging lp:~rvb/launchpad/sync-bug-827608-populate-ancestor into lp:launchpad/db-devel with lp:~rvb/launchpad/sync-bug-827608-spph-creator as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #827608 in Launchpad itself: "Sync requester isn't credited with upload"
https://bugs.launchpad.net/launchpad/+bug/827608
For more details, see:
https://code.launchpad.net/~rvb/launchpad/sync-bug-827608-populate-ancestor/+merge/74577
This branch populates the SourcePackagePublishingHistory's ancestor column when the new spph is created by being copied over. The ancestor field was first created to calculate a common ancestor given two spphs but then the common ancestor was calculated by looking at changelogs instead. The ancestor field was left non populated (the prod db was checked). This branch fixes this so that we can track where a spph was copied from. We will need this to be able to work out whether or not someone should get credits on ~/me/+related-software for having copied a package.
= Tests =
./bin/test -vvc test_publishing test_copyTo_sets_ancestor
= QA =
None.
--
https://code.launchpad.net/~rvb/launchpad/sync-bug-827608-populate-ancestor/+merge/74577
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/launchpad/sync-bug-827608-populate-ancestor into lp:launchpad/db-devel.
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2011-09-08 10:33:17 +0000
+++ lib/lp/soyuz/model/publishing.py 2011-09-08 10:33:17 +0000
@@ -814,7 +814,7 @@
component,
section,
pocket,
- ancestor=None,
+ ancestor=self,
create_dsd_job=create_dsd_job,
creator=creator)
=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
--- lib/lp/soyuz/tests/test_publishing.py 2011-09-08 10:33:17 +0000
+++ lib/lp/soyuz/tests/test_publishing.py 2011-09-08 10:33:17 +0000
@@ -1012,6 +1012,15 @@
# Section has no default so it comes from the old publication.
self.assertEqual(spph.section, copy.section)
+ def test_copyTo_sets_ancestor(self):
+ # SPPH's ancestor get's populated when a spph is copied over.
+ target_archive = self.factory.makeArchive()
+ spph = self.factory.makeSourcePackagePublishingHistory()
+ copy = spph.copyTo(
+ spph.distroseries, spph.pocket, target_archive)
+
+ self.assertEqual(spph, copy.ancestor)
+
class BuildRecordCreationTests(TestNativePublishingBase):
"""Test the creation of build records."""