launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22871
Re: [Merge] lp:~twom/launchpad/pending-but-not-merged into lp:launchpad
Diff comments:
> === modified file 'lib/lp/code/browser/gitrepository.py'
> --- lib/lp/code/browser/gitrepository.py 2018-08-30 14:54:37 +0000
> +++ lib/lp/code/browser/gitrepository.py 2018-08-31 11:44:12 +0000
> @@ -397,6 +397,12 @@
> targets = self.context.getPrecachedLandingTargets(self.user)
> return latest_proposals_for_each_branch(targets)
>
> + @cachedproperty
> + def active_landing_targets(self):
With this, I think the landing_targets property on the view is unused. Could you just delete it and rename this one to landing_targets?
> + targets = self.context.getPrecachedLandingTargets(
> + self.user, ignore_merged=True)
> + return latest_proposals_for_each_branch(targets)
> +
>
> class GitRepositoryEditFormView(LaunchpadEditFormView):
> """Base class for forms that edit a Git repository."""
>
> === modified file 'lib/lp/code/model/gitrepository.py'
> --- lib/lp/code/model/gitrepository.py 2018-08-29 17:11:57 +0000
> +++ lib/lp/code/model/gitrepository.py 2018-08-31 11:44:12 +0000
> @@ -887,10 +887,15 @@
> BranchMergeProposal,
> BranchMergeProposal.source_git_repository == self)
>
> - def getPrecachedLandingTargets(self, user):
> + def getPrecachedLandingTargets(self, user, ignore_merged=False):
This is a bit more than ignoring merged proposals; it ignores any proposal that isn't in a final state. Maybe something like "only_active" instead?
> """See `IGitRepository`."""
> + results = self.landing_targets
> + if ignore_merged:
> + results = self.landing_targets.find(
> + Not(BranchMergeProposal.queue_status.is_in(
> + BRANCH_MERGE_PROPOSAL_FINAL_STATES)))
> loader = partial(BranchMergeProposal.preloadDataForBMPs, user=user)
> - return DecoratedResultSet(self.landing_targets, pre_iter_hook=loader)
> + return DecoratedResultSet(results, pre_iter_hook=loader)
>
> @property
> def _api_landing_targets(self):
--
https://code.launchpad.net/~twom/launchpad/pending-but-not-merged/+merge/354108
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~twom/launchpad/pending-but-not-merged into lp:launchpad.
References