launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #09155
[Merge] lp:~cjwatson/launchpad/pcj-reupload-fix into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/pcj-reupload-fix into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #334858 in Launchpad itself: "Require a way to copy [P]PPA packages into Ubuntu"
https://bugs.launchpad.net/launchpad/+bug/334858
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/pcj-reupload-fix/+merge/111804
== Summary ==
https://code.launchpad.net/~cjwatson/launchpad/pcj-reupload/+merge/111124 didn't quite work, as indicated in the QA notes on bug 334858.
== Proposed fix ==
Add the missing transaction.commit. We didn't notice this in tests because the test in question didn't set SPR.changelog, so fix that too.
== LOC Rationale ==
+5. Same rationale as https://code.launchpad.net/~cjwatson/launchpad/pcj-reupload/+merge/111124.
== Tests ==
bin/test -vvct test_packagecopyjob
== Demo and Q/A ==
Same as https://code.launchpad.net/~cjwatson/launchpad/pcj-reupload/+merge/111124.
--
https://code.launchpad.net/~cjwatson/launchpad/pcj-reupload-fix/+merge/111804
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/pcj-reupload-fix into lp:launchpad.
=== modified file 'lib/lp/soyuz/scripts/packagecopier.py'
--- lib/lp/soyuz/scripts/packagecopier.py 2012-06-22 23:55:02 +0000
+++ lib/lp/soyuz/scripts/packagecopier.py 2012-06-25 10:00:35 +0000
@@ -22,6 +22,7 @@
import apt_pkg
from lazr.delegates import delegates
+import transaction
from zope.component import getUtility
from zope.security.proxy import removeSecurityProxy
@@ -790,6 +791,8 @@
if logger is not None:
logger.info(
"Re-uploaded %s to librarian" % new_file.filename)
+ # Commit so that the caller can see the newly-public files.
+ transaction.commit()
return copies
=== modified file 'lib/lp/soyuz/tests/test_packagecopyjob.py'
--- lib/lp/soyuz/tests/test_packagecopyjob.py 2012-06-19 23:49:20 +0000
+++ lib/lp/soyuz/tests/test_packagecopyjob.py 2012-06-25 10:00:35 +0000
@@ -1118,8 +1118,10 @@
version="2.8-1", status=PackagePublishingStatus.PUBLISHED,
component='multiverse', section='web',
archive=source_archive)
- for source_file in spph.sourcepackagerelease.files:
+ spr = spph.sourcepackagerelease
+ for source_file in spr.files:
self.assertTrue(source_file.libraryfile.restricted)
+ spr.changelog = self.factory.makeLibraryFileAlias(restricted=True)
# Now, run the copy job.
source = getUtility(IPlainPackageCopyJobSource)
Follow ups