Merge lp:~lifeless/launchpad/bug-618372 into lp:launchpad

Proposed by Robert Collins
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: 11487
Proposed branch: lp:~lifeless/launchpad/bug-618372
Merge into: lp:launchpad
Diff against target: 22 lines (+3/-2)
1 file modified
lib/lp/registry/model/distribution.py (+3/-2)
To merge this branch: bzr merge lp:~lifeless/launchpad/bug-618372
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+34383@code.launchpad.net

Commit message

Tiny tweak to localise the use of a table in Distribution._binarySearchClause (only one call site wants it).

Description of the change

Tiny tweak to localise the use of a table in Distribution._binarySearchClause (only one call site wants it).

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Looks fine. I hope this code path is tested!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/model/distribution.py'
2--- lib/lp/registry/model/distribution.py 2010-08-31 05:58:45 +0000
3+++ lib/lp/registry/model/distribution.py 2010-09-02 05:35:55 +0000
4@@ -1241,7 +1241,6 @@
5 return (
6 DistroSeries.distribution == self,
7 DistroSeries.status != SeriesStatus.OBSOLETE,
8- BinaryPackageRelease.binarypackagename == BinaryPackageName.id,
9 DistroArchSeries.distroseries == DistroSeries.id,
10 BinaryPackageBuild.distro_arch_series == DistroArchSeries.id,
11 BinaryPackageRelease.build == BinaryPackageBuild.id,
12@@ -1261,7 +1260,9 @@
13 select_spec = (DistributionSourcePackageCache,)
14
15 if exact_match:
16- find_spec = self._binaryPackageSearchClause
17+ find_spec = self._binaryPackageSearchClause + (
18+ BinaryPackageRelease.binarypackagename == BinaryPackageName.id,
19+ )
20 match_clause = (BinaryPackageName.name == package_name,)
21 else:
22 # In this case we can use a simplified find-spec as the