← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/refactor-branch-listing-sort into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/code/feed/branch.py'
> --- lib/lp/code/feed/branch.py	2015-07-08 16:05:11 +0000
> +++ lib/lp/code/feed/branch.py	2017-06-15 01:08:14 +0000
> @@ -165,11 +161,10 @@
>          """
>          collection = self._getCollection().visibleByUser(
>              None).withLifecycleStatus(*DEFAULT_BRANCH_STATUS_IN_LISTING)
> -        branches = collection.getBranches(eager_load=False)
> -        return list(branches.order_by(
> -            Desc(Branch.date_last_modified), Asc(Branch.target_suffix),
> -            Desc(Branch.lifecycle_status), Asc(Branch.name)).config(

That was quite an order.

> -                limit=self.quantity))
> +        branches = collection.getBranches(
> +            eager_load=False,
> +            sort_by=BranchListingSort.MOST_RECENTLY_CHANGED_FIRST)
> +        return list(branches.config(limit=self.quantity))
>  
>  
>  class ProductBranchFeed(BranchListingFeed):


-- 
https://code.launchpad.net/~cjwatson/launchpad/refactor-branch-listing-sort/+merge/325708
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References