Raphaël Victor Badin has proposed merging
lp:~rvb/launchpad/sync-bug-827608-populate-ancestor into lp:launchpad with
lp:~rvb/launchpad/sync-bug-827608-spph-creator-code 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/74737
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/74737
Your team Launchpad code reviewers is requested to review the proposed merge of
lp:~rvb/launchpad/sync-bug-827608-populate-ancestor into lp:launchpad.
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2011-09-09 09:19:25 +0000
+++ lib/lp/soyuz/model/publishing.py 2011-09-09 09:19:25 +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-09 09:19:25 +0000
+++ lib/lp/soyuz/tests/test_publishing.py 2011-09-09 09:19:25 +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."""
_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help : https://help.launchpad.net/ListHelp