Merge lp:~jpds/launchpad/fix_116279 into lp:launchpad

Proposed by Jonathan Davies
Status: Work in progress
Proposed branch: lp:~jpds/launchpad/fix_116279
Merge into: lp:launchpad
Diff against target: 12 lines (+2/-0)
1 file modified
lib/lp/registry/browser/distributionmirror.py (+2/-0)
To merge this branch: bzr merge lp:~jpds/launchpad/fix_116279
Reviewer Review Type Date Requested Status
Henning Eggers (community) code Needs Fixing
Review via email: mp+17940@code.launchpad.net

Commit message

On CD image mirror pages, list Ubuntu first and then derivatives.

To post a comment you must log in.
Revision history for this message
Jonathan Davies (jpds) wrote :

= Summary =

On our CD image mirror pages, list the derivatives last and place Ubuntu first. Because these aren't in the DB, we have to and .sort() and then .reverse() them as they are read from the .manifest file.

Revision history for this message
Henning Eggers (henninge) wrote :

Thanks for this fix but looking at it I am missing a few things.

1. Did you have a pre-imp chat with some-one from the Launchpad team, preferrably the registry team? I am not sure this solution is ideal because Ubuntu will only be on top until someone comes up with "Zulubuntu" ... ;-)
2. Aren't any tests affected by the change? That would be surprising.
3. In any case, you'd need a test to verify that the order is now as expected.

Cheers,
Henning

review: Needs Fixing (code)

Unmerged revisions

10096. By Jonathan Davies

Sort CD image mirror flavours and then reverse the listing so that Ubuntu comes
first.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/distributionmirror.py'
2--- lib/lp/registry/browser/distributionmirror.py 2009-12-12 22:15:31 +0000
3+++ lib/lp/registry/browser/distributionmirror.py 2010-01-23 15:01:22 +0000
4@@ -143,6 +143,8 @@
5 flavours_by_series = _FlavoursByDistroSeries(series, [])
6 all_series[series] = flavours_by_series
7 flavours_by_series.flavours.append(flavour)
8+ flavours_by_series.flavours.sort()
9+ flavours_by_series.flavours.reverse()
10 flavours_by_series = all_series.values()
11 return sorted(flavours_by_series, reverse=True,
12 key=lambda item: Version(item.distroseries.version))