Merge lp:~cjwatson/launchpad/fix-ordering into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18940
Proposed branch: lp:~cjwatson/launchpad/fix-ordering
Merge into: lp:launchpad
Diff against target: 55 lines (+10/-4)
3 files modified
lib/lp/bugs/model/bug.py (+2/-1)
lib/lp/registry/model/distroseries.py (+6/-2)
lib/lp/soyuz/model/publishing.py (+2/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fix-ordering
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+366102@code.launchpad.net

Commit message

Sort the results of various methods to match test assertions.

Description of the change

For some reason I see corresponding test failures locally but not on buildbot.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
Colin Watson (cjwatson) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py 2019-01-10 11:41:30 +0000
+++ lib/lp/bugs/model/bug.py 2019-04-16 11:18:04 +0000
@@ -1383,9 +1383,10 @@
1383 return EmptyResultSet()1383 return EmptyResultSet()
1384 else:1384 else:
1385 branch_ids = [branch.id for branch in linked_branches]1385 branch_ids = [branch.id for branch in linked_branches]
1386 return Store.of(self).find(1386 results = Store.of(self).find(
1387 BugBranch,1387 BugBranch,
1388 BugBranch.bug == self, In(BugBranch.branchID, branch_ids))1388 BugBranch.bug == self, In(BugBranch.branchID, branch_ids))
1389 return results.order_by(BugBranch.id)
13891390
1390 def linkMergeProposal(self, merge_proposal, user, check_permissions=True):1391 def linkMergeProposal(self, merge_proposal, user, check_permissions=True):
1391 """See `IBug`."""1392 """See `IBug`."""
13921393
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2019-02-13 14:39:18 +0000
+++ lib/lp/registry/model/distroseries.py 2019-04-16 11:18:04 +0000
@@ -1110,7 +1110,9 @@
1110 SourcePackagePublishingHistory.pocket == pocket,1110 SourcePackagePublishingHistory.pocket == pocket,
1111 SourcePackagePublishingHistory.component == component,1111 SourcePackagePublishingHistory.component == component,
1112 SourcePackagePublishingHistory.status ==1112 SourcePackagePublishingHistory.status ==
1113 PackagePublishingStatus.PUBLISHED)1113 PackagePublishingStatus.PUBLISHED,
1114 SourcePackagePublishingHistory.sourcepackagename ==
1115 SourcePackageName.id).order_by(SourcePackageName.name)
11141116
1115 def eager_load(spphs):1117 def eager_load(spphs):
1116 # Preload everything which will be used by archivepublisher's1118 # Preload everything which will be used by archivepublisher's
@@ -1146,7 +1148,9 @@
1146 BinaryPackagePublishingHistory.pocket == pocket,1148 BinaryPackagePublishingHistory.pocket == pocket,
1147 BinaryPackagePublishingHistory.component == component,1149 BinaryPackagePublishingHistory.component == component,
1148 BinaryPackagePublishingHistory.status ==1150 BinaryPackagePublishingHistory.status ==
1149 PackagePublishingStatus.PUBLISHED)1151 PackagePublishingStatus.PUBLISHED,
1152 BinaryPackagePublishingHistory.binarypackagename ==
1153 BinaryPackageName.id).order_by(BinaryPackageName.name)
11501154
1151 def eager_load(bpphs):1155 def eager_load(bpphs):
1152 # Preload everything which will be used by archivepublisher's1156 # Preload everything which will be used by archivepublisher's
11531157
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2018-05-23 13:24:03 +0000
+++ lib/lp/soyuz/model/publishing.py 2019-04-16 11:18:04 +0000
@@ -314,7 +314,8 @@
314 BinaryPackageBuild.id == BinaryPackageRelease.buildID,314 BinaryPackageBuild.id == BinaryPackageRelease.buildID,
315 BinaryPackageBuild.source_package_release_id ==315 BinaryPackageBuild.source_package_release_id ==
316 self.sourcepackagereleaseID,316 self.sourcepackagereleaseID,
317 DistroArchSeries.distroseriesID == self.distroseriesID))317 DistroArchSeries.distroseriesID == self.distroseriesID).order_by(
318 Desc(BinaryPackagePublishingHistory.id)))
318319
319 # Preload attached BinaryPackageReleases.320 # Preload attached BinaryPackageReleases.
320 bpr_ids = set(321 bpr_ids = set(