launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15096
[Merge] lp:~stevenk/launchpad/unexport-updatepreviewdiff into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/unexport-updatepreviewdiff into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/unexport-updatepreviewdiff/+merge/146744
No longer export IBranchMergeProposal.updatePreviewDiff() over the API.
--
https://code.launchpad.net/~stevenk/launchpad/unexport-updatepreviewdiff/+merge/146744
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/unexport-updatepreviewdiff into lp:launchpad.
=== modified file 'lib/lp/_schema_circular_imports.py'
--- lib/lp/_schema_circular_imports.py 2013-01-25 03:30:08 +0000
+++ lib/lp/_schema_circular_imports.py 2013-02-05 23:09:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Update the interface schema values due to circular imports.
@@ -795,7 +795,7 @@
patch_entry_explicit_version(IBranchMergeProposal, 'beta')
patch_operations_explicit_version(
IBranchMergeProposal, 'beta', "createComment", "getComment",
- "nominateReviewer", "setStatus", "updatePreviewDiff")
+ "nominateReviewer", "setStatus")
# IBranchMergeQueue
patch_entry_explicit_version(IBranchMergeQueue, 'beta')
=== modified file 'lib/lp/code/interfaces/branchmergeproposal.py'
--- lib/lp/code/interfaces/branchmergeproposal.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/interfaces/branchmergeproposal.py 2013-02-05 23:09:21 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""The interface for branch merge proposals."""
@@ -54,7 +54,6 @@
)
from zope.schema import (
Bool,
- Bytes,
Choice,
Datetime,
Int,
@@ -521,11 +520,6 @@
def deleteProposal():
"""Delete the proposal to merge."""
- @operation_parameters(
- diff_content=Bytes(), source_revision_id=TextLine(),
- target_revision_id=TextLine(), prerequisite_revision_id=TextLine(),
- conflicts=Text())
- @export_write_operation()
def updatePreviewDiff(diff_content, source_revision_id,
target_revision_id, prerequisite_revision_id=None,
conflicts=None):
=== modified file 'lib/lp/code/stories/webservice/xx-branchmergeproposal.txt'
--- lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2012-09-18 18:36:09 +0000
+++ lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2013-02-05 23:09:21 +0000
@@ -314,72 +314,6 @@
>>> print merge_proposal['reviewed_revid']
None
-
-== Updating the preview diff ==
-
-The merge proposal can now be updated with the diff that reflects what the
-merge would look like if the source branch was merged into the target branch.
-
- >>> diff_content = '''\
- ... === modified file 'fooix.txt'
- ... --- fooix.txt\t2009-01-01 12:00:00 +0000
- ... +++ fooix.txt\t2009-02-02 12:34:56 +0000
- ... @@ -206,7 +206,7 @@
- ... original
- ... -removed
- ... +added
- ... '''
- >>> response = reviewer_webservice.named_post(
- ... merge_proposal['self_link'], 'updatePreviewDiff',
- ... diff_content=diff_content,
- ... source_revision_id='rev-a',
- ... target_revision_id='rev-b', conflicts='oh, no conflicts')
- >>> print response
- HTTP/1.1 200 Ok
- ...
- Content-Type: application/json
- ...
- Vary: ...
- ...
-
-The diff is now visible through the merge proposal.
-
- >>> merge_proposal = webservice.get(proposal_url).jsonBody()
- >>> preview_diff = webservice.get(
- ... merge_proposal['preview_diff_link']).jsonBody()
- >>> pprint_entry(preview_diff)
- added_lines_count: 0
- branch_merge_proposal_link:
- u'http://.../~source/fooix/fix-it/+merge/...'
- conflicts: u'oh, no conflicts'
- diff_lines_count: 7
- diff_text_link:
- u'http://.../~source/fooix/fix-it/+merge/.../+preview-diff/diff_text'
- diffstat: {u'fooix.txt': [0, 0]}
- prerequisite_revision_id: None
- removed_lines_count: 0
- resource_type_link: u'http://.../#preview_diff'
- self_link:
- u'http://.../~source/fooix/fix-it/+merge/.../+preview-diff'
- source_revision_id: u'rev-a'
- stale: True
- target_revision_id: u'rev-b'
-
-It is possible that the diff will be empty.
-
- >>> response = reviewer_webservice.named_post(
- ... merge_proposal['self_link'], 'updatePreviewDiff',
- ... diff_content='',
- ... diff_stat='', source_revision_id='rev-c',
- ... target_revision_id='rev-d', conflicts=None)
- >>> print response
- HTTP/1.1 200 Ok
- ...
- Content-Type: application/json
- ...
- Vary: ...
- ...
-
== Getting a Project's Pending Merge Proposals ==
It is possible to view all of a project's merge proposals or filter the