Merge lp:~abentley/launchpad/find-review into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 11949 |
Proposed branch: | lp:~abentley/launchpad/find-review |
Merge into: | lp:launchpad |
Diff against target: |
180 lines (+60/-6) 6 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+2/-0) lib/lp/code/interfaces/branch.py (+15/-0) lib/lp/code/model/branch.py (+5/-3) lib/lp/code/model/branchcollection.py (+4/-1) lib/lp/code/model/tests/test_branch.py (+15/-2) lib/lp/code/model/tests/test_branchcollection.py (+19/-0) |
To merge this branch: | bzr merge lp:~abentley/launchpad/find-review |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
j.c.sackett (community) | code* | Approve | |
Review via email: mp+41195@code.launchpad.net |
Description of the change
= Summary =
Fix bug #677077: It should be possible to find the merge proposal that approved
a revision via the API
== Proposed fix ==
IBranch.
== Pre-implementation notes ==
None
== Implementation details ==
IBranch derives from IHasMergeProposals, so it already provides
getMergeProposals. merged_revnos only makes sense in the context of a single
branch, because a revnos only refers to a specific revision in the context of a
branch. Therefore, merged_revnos could not be provided on IHasMergeProposals.
Therefore, getMergeProposals was exposed on IBranch.
merge_revnos is plural (not merged_revno) in order to support efficient access
to multiple merge proposals, should that be desired.
== Tests ==
bin/test -t test_getMergePr
== Demo and Q/A ==
Write a commandline script that uses merged_revnos to get a merge proposal over
the API.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/canonical
lib/lp/
Aaron--
This seems like a really nice feature to have in the API, particularly given recent reviewers conversations.
Also, thanks for explaining some of the pain you had to go through for circular imports on IRC. It was very informative.
> === modified file 'lib/lp/ code/model/ branchcollectio n.py' code/model/ branchcollectio n.py 2010-08-20 20:31:18 +0000 code/model/ branchcollectio n.py 2010-11-18 16:50:14 +0000 using(* tables) .find(Branch, *expressions) ls(self, statuses=None, for_branches=None, branch= None): revnos= None): ion`."" " osal.source_ branchID. is_in(
> --- lib/lp/
> +++ lib/lp/
> @@ -145,7 +145,7 @@
> return self.store.
>
> def getMergeProposa
> - target_
> + target_branch=None, merged_
> """See `IBranchCollect
> expressions = [
> BranchMergeProp
I brought the mismatch between this method definition and the interface definition with regards to merged_revnos as an argument up on IRC, and I buy your argument that it's not required b/c there's no security proxy and adding it would break other things.
It's not a blocker for merging, but a comment here to explain the difference or something wouldn't suck. :-)
> === modified file 'lib/lp/ code/model/ tests/test_ branch. py' code/model/ tests/test_ branch. py 2010-11-04 19:59:02 +0000 code/model/ tests/test_ branch. py 2010-11-18 16:50:14 +0000 rgeProposal, ueConfig, event.branchmer geproposal import NewBranchMergeP roposalEvent interfaces. branch import ( BRANCH_ STATUS_ IN_LISTING, makeBranch( ) logged_ in(branch. owner): setMergeQueueCo nfig(config)
> --- lib/lp/
> +++ lib/lp/
> @@ -66,7 +66,6 @@
> InvalidBranchMe
> InvalidMergeQue
> )
> -from lp.code.
> from lp.code.
> DEFAULT_
> IBranch,
> @@ -2757,7 +2756,8 @@
> branch = self.factory.
> config = simplejson.dumps({
> 'path': '/',
> - 'test': 'make test',})
> + 'test': 'make test',
> + })
>
> with person_
> branch.
Thanks for doing that cleanup.