Merge lp:~thumper/launchpad/use-last-rev-id into lp:launchpad
- use-last-rev-id
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~thumper/launchpad/use-last-rev-id |
Merge into: | lp:launchpad |
Diff against target: |
411 lines (+138/-43) 8 files modified
lib/canonical/launchpad/javascript/code/branchmergeproposal.js (+81/-8) lib/lp/code/browser/branchmergeproposal.py (+1/-0) lib/lp/code/doc/branch-merge-proposals.txt (+4/-5) lib/lp/code/interfaces/branchmergeproposal.py (+5/-5) lib/lp/code/model/branchmergeproposal.py (+5/-2) lib/lp/code/stories/webservice/xx-branchmergeproposal.txt (+7/-7) lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt (+27/-13) lib/lp/code/windmill/tests/test_branchmergeproposal_commitmessage.py (+8/-3) |
To merge this branch: | bzr merge lp:~thumper/launchpad/use-last-rev-id |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | ui | Approve | |
Paul Hummer (community) | code js ui* | Approve | |
Review via email: mp+20023@code.launchpad.net |
Commit message
Send through the last scanned id when approving a merge proposal and update the table asynchronously.
Description of the change
Tim Penhey (thumper) wrote : | # |
Tim Penhey (thumper) wrote : | # |
Changed the windmill test to use the approved value and check for the approved revision id.
Paul Hummer (rockstar) wrote : | # |
Think adding a few comments to the insertion code would be helpful. When I look at the patch, I know what the javascript is doing because I see the tal changes as well. Seeing the javascript by itself might be a little confusing (it is a bit hairy, but clever).
Tim Penhey (thumper) wrote : | # |
http://
Michael Nelson (michael.nelson) wrote : | # |
> Need to find a good way to test this.
Heh, a script to setup the environment that you demo'd would be great. I just created an MP for ~name12/
UI-wise, it works really well, updating the display with the extra row when necessary. I laughed in your video near the end where you go to update the version number, but then hesitate and stop the video... made me click it ;). So I assume that'll get done later... do you think it's worth doing it before landing this branch? The non-js fallback works fine, but it does seem strange that it doesn't bring up an overlay and update inline. Up to you.
Now, nothing to do with a UI review, but I wrote a DynamicDomUpdater a while back for this *type* of thing - basically it allows you to plug-in the functionality so that a node (for example, a table node) knows how to update itself. YMMV, but you can find it at:
lib/canonical/
tested at:
lib/canonical/
Cheers,
Michael.
Tim Penhey (thumper) wrote : | # |
Setting the merged revision id has always behaved like that. I hesitated because it wasn't want I was wanting to demonstrate :) I'll take a look at the dynamic dom updater at some stage.
Preview Diff
1 | === modified file 'lib/canonical/launchpad/javascript/code/branchmergeproposal.js' | |||
2 | --- lib/canonical/launchpad/javascript/code/branchmergeproposal.js 2009-11-23 19:29:02 +0000 | |||
3 | +++ lib/canonical/launchpad/javascript/code/branchmergeproposal.js 2010-02-26 00:40:38 +0000 | |||
4 | @@ -32,19 +32,24 @@ | |||
5 | 32 | success: function(entry) { | 32 | success: function(entry) { |
6 | 33 | var cb = status_choice_edit.get('contentBox'); | 33 | var cb = status_choice_edit.get('contentBox'); |
7 | 34 | Y.Array.each(conf.status_widget_items, function(item) { | 34 | Y.Array.each(conf.status_widget_items, function(item) { |
15 | 35 | if (item.value == status_choice_edit.get( | 35 | if (item.value == status_choice_edit.get('value')) { |
16 | 36 | 'value')) { | 36 | cb.query('span').addClass(item.css_class); |
17 | 37 | cb.query('span').addClass(item.css_class); | 37 | } else { |
18 | 38 | } else { | 38 | cb.query('span').removeClass(item.css_class); |
19 | 39 | cb.query('span').removeClass(item.css_class); | 39 | } |
20 | 40 | } | 40 | }); |
21 | 41 | }); | 41 | update_summary(); |
22 | 42 | }, | ||
23 | 43 | end: function() { | ||
24 | 44 | status_content.one('img').set('src', '/@@/edit'); | ||
25 | 42 | } | 45 | } |
26 | 43 | }, | 46 | }, |
27 | 44 | parameters: { | 47 | parameters: { |
29 | 45 | status: status_choice_edit.get('value') | 48 | status: status_choice_edit.get('value'), |
30 | 49 | revid: conf.source_revid | ||
31 | 46 | } | 50 | } |
32 | 47 | }; | 51 | }; |
33 | 52 | status_content.one('img').set('src', '/@@/spinner'); | ||
34 | 48 | lp_client = new LP.client.Launchpad(); | 53 | lp_client = new LP.client.Launchpad(); |
35 | 49 | lp_client.named_post( | 54 | lp_client.named_post( |
36 | 50 | LP.client.cache.context.self_link, 'setStatus', config); | 55 | LP.client.cache.context.self_link, 'setStatus', config); |
37 | @@ -54,4 +59,72 @@ | |||
38 | 54 | } | 59 | } |
39 | 55 | }; | 60 | }; |
40 | 56 | 61 | ||
41 | 62 | /* | ||
42 | 63 | * Update the summary table for the merge proposal. | ||
43 | 64 | * | ||
44 | 65 | * An async request is made for the summary table, and the content is | ||
45 | 66 | * inspected. We don't modify the status row as it is in the process of having | ||
46 | 67 | * animations run on it. Each of the table rows has an id that is strictly | ||
47 | 68 | * alphabetical. This ordering is used to determine if a row needs to be | ||
48 | 69 | * added or removed to the table shown on the current page. If the row | ||
49 | 70 | * appears in both, the content is checked (except for diffs as that'll never | ||
50 | 71 | * be the same due to the javascript added classes) and if it differs the | ||
51 | 72 | * shown rows are updated. | ||
52 | 73 | */ | ||
53 | 74 | function update_summary() { | ||
54 | 75 | var existing_summary = Y.one('#proposal-summary tbody'); | ||
55 | 76 | SUMMARY_SNIPPET = '+pagelet-summary'; | ||
56 | 77 | Y.io(SUMMARY_SNIPPET, { | ||
57 | 78 | on: { | ||
58 | 79 | success: function(id, response) { | ||
59 | 80 | var new_summary = Y.Node.create(response.responseText); | ||
60 | 81 | var new_rows = new_summary.all('tr'); | ||
61 | 82 | var old_rows = existing_summary.all('tr'); | ||
62 | 83 | // Skip over the status row (row 0). | ||
63 | 84 | var new_pos = 1; | ||
64 | 85 | var old_pos = 1; | ||
65 | 86 | var new_size = new_rows.size(); | ||
66 | 87 | var old_size = old_rows.size(); | ||
67 | 88 | |||
68 | 89 | while (new_pos < new_size && old_pos < old_size) { | ||
69 | 90 | var new_row = new_rows.item(new_pos); | ||
70 | 91 | var old_row = old_rows.item(old_pos); | ||
71 | 92 | var new_id = new_row.get('id'); | ||
72 | 93 | var old_id = old_row.get('id'); | ||
73 | 94 | if (new_id == old_id) { | ||
74 | 95 | if (new_id != 'summary-row-b-diff') { | ||
75 | 96 | // Don't mess with the diff. | ||
76 | 97 | if (new_row.get('innerHTML') != | ||
77 | 98 | old_row.get('innerHTML')) { | ||
78 | 99 | existing_summary.insertBefore(new_row, old_row); | ||
79 | 100 | old_row.remove(); | ||
80 | 101 | } | ||
81 | 102 | } | ||
82 | 103 | ++new_pos; | ||
83 | 104 | ++old_pos; | ||
84 | 105 | } else if (new_id < old_id) { | ||
85 | 106 | ++new_pos; | ||
86 | 107 | existing_summary.insertBefore(new_row, old_row); | ||
87 | 108 | } else { | ||
88 | 109 | ++old_pos; | ||
89 | 110 | old_row.remove(); | ||
90 | 111 | } | ||
91 | 112 | } | ||
92 | 113 | // Remove all left over old rows, and add all left over new rows. | ||
93 | 114 | while (old_pos < old_size) { | ||
94 | 115 | var old_row = old_rows.item(old_pos); | ||
95 | 116 | ++old_pos; | ||
96 | 117 | old_row.remove(); | ||
97 | 118 | } | ||
98 | 119 | while (new_pos < new_size) { | ||
99 | 120 | var new_row = new_rows.item(new_pos); | ||
100 | 121 | ++new_pos; | ||
101 | 122 | if (new_row.get('id') != 'summary-row-b-diff') { | ||
102 | 123 | existing_summary.append(new_row); | ||
103 | 124 | } | ||
104 | 125 | } | ||
105 | 126 | } | ||
106 | 127 | }}); | ||
107 | 128 | } | ||
108 | 129 | |||
109 | 57 | }, "0.1", {"requires": ["io", "node", "lazr.choiceedit", "lp.client.plugins"]}); | 130 | }, "0.1", {"requires": ["io", "node", "lazr.choiceedit", "lp.client.plugins"]}); |
110 | 58 | 131 | ||
111 | === modified file 'lib/lp/code/browser/branchmergeproposal.py' | |||
112 | --- lib/lp/code/browser/branchmergeproposal.py 2010-02-05 21:59:26 +0000 | |||
113 | +++ lib/lp/code/browser/branchmergeproposal.py 2010-02-26 00:40:39 +0000 | |||
114 | @@ -687,6 +687,7 @@ | |||
115 | 687 | self._createStatusVocabulary(), | 687 | self._createStatusVocabulary(), |
116 | 688 | css_class_prefix='mergestatus'), | 688 | css_class_prefix='mergestatus'), |
117 | 689 | 'status_value': self.context.queue_status.title, | 689 | 'status_value': self.context.queue_status.title, |
118 | 690 | 'source_revid': self.context.source_branch.last_scanned_id, | ||
119 | 690 | 'user_can_edit_status': check_permission( | 691 | 'user_can_edit_status': check_permission( |
120 | 691 | 'launchpad.Edit', self.context), | 692 | 'launchpad.Edit', self.context), |
121 | 692 | }) | 693 | }) |
122 | 693 | 694 | ||
123 | === modified file 'lib/lp/code/doc/branch-merge-proposals.txt' | |||
124 | --- lib/lp/code/doc/branch-merge-proposals.txt 2009-10-01 17:41:10 +0000 | |||
125 | +++ lib/lp/code/doc/branch-merge-proposals.txt 2010-02-26 00:40:38 +0000 | |||
126 | @@ -257,12 +257,11 @@ | |||
127 | 257 | >>> print proposal.queue_status.title | 257 | >>> print proposal.queue_status.title |
128 | 258 | Needs review | 258 | Needs review |
129 | 259 | 259 | ||
133 | 260 | Branches that had been approved that have subsequently been | 260 | Branches that had been approved that have subsequently been set back into the |
134 | 261 | set back into the needs review state still retain their old reviewed | 261 | needs review state have their reviewed revision cleared. |
132 | 262 | revision id. | ||
135 | 263 | 262 | ||
138 | 264 | >>> proposal.reviewed_revision_id == tip.revision_id | 263 | >>> print proposal.reviewed_revision_id |
139 | 265 | True | 264 | None |
140 | 266 | 265 | ||
141 | 267 | If the target branch has specified a specific reviewer, then either the owner | 266 | If the target branch has specified a specific reviewer, then either the owner |
142 | 268 | of the target branch or the reviewer is able to approve or reject the | 267 | of the target branch or the reviewer is able to approve or reject the |
143 | 269 | 268 | ||
144 | === modified file 'lib/lp/code/interfaces/branchmergeproposal.py' | |||
145 | --- lib/lp/code/interfaces/branchmergeproposal.py 2010-01-11 20:07:17 +0000 | |||
146 | +++ lib/lp/code/interfaces/branchmergeproposal.py 2010-02-26 00:40:38 +0000 | |||
147 | @@ -133,7 +133,7 @@ | |||
148 | 133 | Text( | 133 | Text( |
149 | 134 | title=_( | 134 | title=_( |
150 | 135 | "The revision id that has been approved by the reviewer.")), | 135 | "The revision id that has been approved by the reviewer.")), |
152 | 136 | exported_as='reviewed_revno') | 136 | exported_as='reviewed_revid') |
153 | 137 | 137 | ||
154 | 138 | commit_message = exported( | 138 | commit_message = exported( |
155 | 139 | Summary( | 139 | Summary( |
156 | @@ -159,7 +159,7 @@ | |||
157 | 159 | required=False, | 159 | required=False, |
158 | 160 | description=_("The revision id that has been queued for " | 160 | description=_("The revision id that has been queued for " |
159 | 161 | "landing.")), | 161 | "landing.")), |
161 | 162 | exported_as='queued_revno') | 162 | exported_as='queued_revid') |
162 | 163 | 163 | ||
163 | 164 | merged_revno = exported( | 164 | merged_revno = exported( |
164 | 165 | Int( | 165 | Int( |
165 | @@ -269,7 +269,7 @@ | |||
166 | 269 | """True if it is valid for user update the proposal to next_state.""" | 269 | """True if it is valid for user update the proposal to next_state.""" |
167 | 270 | 270 | ||
168 | 271 | @call_with(user=REQUEST_USER) | 271 | @call_with(user=REQUEST_USER) |
170 | 272 | @rename_parameters_as(revision_id='revno') | 272 | @rename_parameters_as(revision_id='revid') |
171 | 273 | @operation_parameters( | 273 | @operation_parameters( |
172 | 274 | status=Choice( | 274 | status=Choice( |
173 | 275 | title=_("The new status of the merge proposal."), | 275 | title=_("The new status of the merge proposal."), |
174 | @@ -284,8 +284,8 @@ | |||
175 | 284 | 284 | ||
176 | 285 | :param status: The new status of the merge proposal. | 285 | :param status: The new status of the merge proposal. |
177 | 286 | :param user: The user making the change. | 286 | :param user: The user making the change. |
180 | 287 | :param revision_id: The revno to provide to the underlying status | 287 | :param revision_id: The revision id to provide to the underlying |
181 | 288 | change method. | 288 | status change method. |
182 | 289 | """ | 289 | """ |
183 | 290 | 290 | ||
184 | 291 | def setAsWorkInProgress(): | 291 | def setAsWorkInProgress(): |
185 | 292 | 292 | ||
186 | === modified file 'lib/lp/code/model/branchmergeproposal.py' | |||
187 | --- lib/lp/code/model/branchmergeproposal.py 2009-12-18 20:14:21 +0000 | |||
188 | +++ lib/lp/code/model/branchmergeproposal.py 2010-02-26 00:40:39 +0000 | |||
189 | @@ -340,8 +340,6 @@ | |||
190 | 340 | self.setAsWorkInProgress() | 340 | self.setAsWorkInProgress() |
191 | 341 | elif status == BranchMergeProposalStatus.NEEDS_REVIEW: | 341 | elif status == BranchMergeProposalStatus.NEEDS_REVIEW: |
192 | 342 | self.requestReview() | 342 | self.requestReview() |
193 | 343 | elif status == BranchMergeProposalStatus.NEEDS_REVIEW: | ||
194 | 344 | self.requestReview() | ||
195 | 345 | elif status == BranchMergeProposalStatus.CODE_APPROVED: | 343 | elif status == BranchMergeProposalStatus.CODE_APPROVED: |
196 | 346 | # Other half of the edge case. If the status is currently queued, | 344 | # Other half of the edge case. If the status is currently queued, |
197 | 347 | # we need to dequeue, otherwise we just approve the branch. | 345 | # we need to dequeue, otherwise we just approve the branch. |
198 | @@ -378,6 +376,11 @@ | |||
199 | 378 | if self.queue_status != BranchMergeProposalStatus.NEEDS_REVIEW: | 376 | if self.queue_status != BranchMergeProposalStatus.NEEDS_REVIEW: |
200 | 379 | self._transitionToState(BranchMergeProposalStatus.NEEDS_REVIEW) | 377 | self._transitionToState(BranchMergeProposalStatus.NEEDS_REVIEW) |
201 | 380 | self.date_review_requested = _date_requested | 378 | self.date_review_requested = _date_requested |
202 | 379 | # Clear out any reviewed or queued values. | ||
203 | 380 | self.reviewer = None | ||
204 | 381 | self.reviewed_revision_id = None | ||
205 | 382 | self.queuer = None | ||
206 | 383 | self.queued_revision_id = None | ||
207 | 381 | 384 | ||
208 | 382 | def isMergable(self): | 385 | def isMergable(self): |
209 | 383 | """See `IBranchMergeProposal`.""" | 386 | """See `IBranchMergeProposal`.""" |
210 | 384 | 387 | ||
211 | === modified file 'lib/lp/code/stories/webservice/xx-branchmergeproposal.txt' | |||
212 | --- lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2010-02-04 16:52:05 +0000 | |||
213 | +++ lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2010-02-26 00:40:39 +0000 | |||
214 | @@ -42,12 +42,12 @@ | |||
215 | 42 | private: False | 42 | private: False |
216 | 43 | queue_position: None | 43 | queue_position: None |
217 | 44 | queue_status: u'Needs review' | 44 | queue_status: u'Needs review' |
219 | 45 | queued_revno: None | 45 | queued_revid: None |
220 | 46 | queuer_link: None | 46 | queuer_link: None |
221 | 47 | registrant_link: u'http://api.launchpad.dev/beta/~person-name...' | 47 | registrant_link: u'http://api.launchpad.dev/beta/~person-name...' |
222 | 48 | resource_type_link: | 48 | resource_type_link: |
223 | 49 | u'http://api.launchpad.dev/beta/#branch_merge_proposal' | 49 | u'http://api.launchpad.dev/beta/#branch_merge_proposal' |
225 | 50 | reviewed_revno: None | 50 | reviewed_revid: None |
226 | 51 | reviewer_link: None | 51 | reviewer_link: None |
227 | 52 | self_link: u'http://api.launchpad.dev/beta/~.../+merge/...' | 52 | self_link: u'http://api.launchpad.dev/beta/~.../+merge/...' |
228 | 53 | source_branch_link: u'http://api.launchpad.dev/beta/~...' | 53 | source_branch_link: u'http://api.launchpad.dev/beta/~...' |
229 | @@ -136,11 +136,11 @@ | |||
230 | 136 | private: False | 136 | private: False |
231 | 137 | queue_position: None | 137 | queue_position: None |
232 | 138 | queue_status: u'Work in progress' | 138 | queue_status: u'Work in progress' |
234 | 139 | queued_revno: None | 139 | queued_revid: None |
235 | 140 | queuer_link: None | 140 | queuer_link: None |
236 | 141 | registrant_link: u'http://.../~person-name...' | 141 | registrant_link: u'http://.../~person-name...' |
237 | 142 | resource_type_link: u'http://.../#branch_merge_proposal' | 142 | resource_type_link: u'http://.../#branch_merge_proposal' |
239 | 143 | reviewed_revno: None | 143 | reviewed_revid: None |
240 | 144 | reviewer_link: None | 144 | reviewer_link: None |
241 | 145 | self_link: u'http://.../~source/fooix/fix-it/+merge/...' | 145 | self_link: u'http://.../~source/fooix/fix-it/+merge/...' |
242 | 146 | source_branch_link: u'http://.../~source/fooix/fix-it' | 146 | source_branch_link: u'http://.../~source/fooix/fix-it' |
243 | @@ -259,13 +259,13 @@ | |||
244 | 259 | 259 | ||
245 | 260 | >>> _unused = reviewer_webservice.named_post( | 260 | >>> _unused = reviewer_webservice.named_post( |
246 | 261 | ... merge_proposal['self_link'], 'setStatus', | 261 | ... merge_proposal['self_link'], 'setStatus', |
248 | 262 | ... status=u'Approved', revno=u'25') | 262 | ... status=u'Approved', revid=u'25') |
249 | 263 | >>> merge_proposal = reviewer_webservice.get( | 263 | >>> merge_proposal = reviewer_webservice.get( |
250 | 264 | ... merge_proposal['self_link']).jsonBody() | 264 | ... merge_proposal['self_link']).jsonBody() |
251 | 265 | 265 | ||
252 | 266 | >>> print merge_proposal['queue_status'] | 266 | >>> print merge_proposal['queue_status'] |
253 | 267 | Approved | 267 | Approved |
255 | 268 | >>> print merge_proposal['reviewed_revno'] | 268 | >>> print merge_proposal['reviewed_revid'] |
256 | 269 | 25 | 269 | 25 |
257 | 270 | 270 | ||
258 | 271 | However, there may have been breakage in the branch, and we need to revert back | 271 | However, there may have been breakage in the branch, and we need to revert back |
259 | @@ -279,7 +279,7 @@ | |||
260 | 279 | 279 | ||
261 | 280 | >>> print merge_proposal['queue_status'] | 280 | >>> print merge_proposal['queue_status'] |
262 | 281 | Work in progress | 281 | Work in progress |
264 | 282 | >>> print merge_proposal['reviewed_revno'] | 282 | >>> print merge_proposal['reviewed_revid'] |
265 | 283 | None | 283 | None |
266 | 284 | 284 | ||
267 | 285 | 285 | ||
268 | 286 | 286 | ||
269 | === modified file 'lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt' | |||
270 | --- lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt 2010-02-02 17:19:05 +0000 | |||
271 | +++ lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt 2010-02-26 00:40:39 +0000 | |||
272 | @@ -6,7 +6,15 @@ | |||
273 | 6 | tal:define="context_menu context/menu:context"> | 6 | tal:define="context_menu context/menu:context"> |
274 | 7 | 7 | ||
275 | 8 | <tbody> | 8 | <tbody> |
277 | 9 | <tr> | 9 | <tal:comment condition="nothing"> |
278 | 10 | <!-- | ||
279 | 11 | Each of the rows in this table have an id that is strictly | ||
280 | 12 | alphabetical (according to ASCII). This is used in the javascript | ||
281 | 13 | processing of the summary to determine which rows have been added, | ||
282 | 14 | and removed through AJAX requests. | ||
283 | 15 | --> | ||
284 | 16 | </tal:comment> | ||
285 | 17 | <tr id="summary-row-1-status"> | ||
286 | 10 | <th>Status:</th> | 18 | <th>Status:</th> |
287 | 11 | <td id="branchmergeproposal-status-value"> | 19 | <td id="branchmergeproposal-status-value"> |
288 | 12 | <span tal:attributes="class string:value mergestatus${context/queue_status/name}" | 20 | <span tal:attributes="class string:value mergestatus${context/queue_status/name}" |
289 | @@ -21,12 +29,14 @@ | |||
290 | 21 | </td> | 29 | </td> |
291 | 22 | </tr> | 30 | </tr> |
292 | 23 | <tal:comment condition="nothing"> | 31 | <tal:comment condition="nothing"> |
295 | 24 | Only show the reviewed section if the state is not superseded. | 32 | <!-- |
296 | 25 | Only show the reviewed revision if not rejected. | 33 | Only show the reviewed section if the state is not superseded. |
297 | 34 | Only show the reviewed revision if not rejected. | ||
298 | 35 | --> | ||
299 | 26 | </tal:comment> | 36 | </tal:comment> |
300 | 27 | <tal:not-superseded condition="not: context/queue_status/enumvalue:SUPERSEDED"> | 37 | <tal:not-superseded condition="not: context/queue_status/enumvalue:SUPERSEDED"> |
301 | 28 | <tal:reviewed condition="context/reviewer"> | 38 | <tal:reviewed condition="context/reviewer"> |
303 | 29 | <tr> | 39 | <tr id="summary-row-2-reviewer"> |
304 | 30 | <th> | 40 | <th> |
305 | 31 | <tal:rejected condition="context/queue_status/enumvalue:REJECTED"> | 41 | <tal:rejected condition="context/queue_status/enumvalue:REJECTED"> |
306 | 32 | Rejected by: | 42 | Rejected by: |
307 | @@ -42,7 +52,8 @@ | |||
308 | 42 | <tal:modified replace="context/date_reviewed/fmt:displaydate" /> | 52 | <tal:modified replace="context/date_reviewed/fmt:displaydate" /> |
309 | 43 | </td> | 53 | </td> |
310 | 44 | </tr> | 54 | </tr> |
312 | 45 | <tr tal:condition="not: context/queue_status/enumvalue:REJECTED"> | 55 | <tr id="summary-row-3-approved-revision" |
313 | 56 | tal:condition="not: context/queue_status/enumvalue:REJECTED"> | ||
314 | 46 | <th>Approved revision:</th> | 57 | <th>Approved revision:</th> |
315 | 47 | <td> | 58 | <td> |
316 | 48 | <tal:not-available condition="not: context/reviewed_revision_id"> | 59 | <tal:not-available condition="not: context/reviewed_revision_id"> |
317 | @@ -57,11 +68,11 @@ | |||
318 | 57 | </tal:reviewed> | 68 | </tal:reviewed> |
319 | 58 | </tal:not-superseded> | 69 | </tal:not-superseded> |
320 | 59 | <tal:queued condition="context/queue_status/enumvalue:QUEUED"> | 70 | <tal:queued condition="context/queue_status/enumvalue:QUEUED"> |
322 | 60 | <tr> | 71 | <tr id="summary-row-4-queued-by"> |
323 | 61 | <th>Queued by:</th> | 72 | <th>Queued by:</th> |
324 | 62 | <td tal:content="structure context/queuer/fmt:link">Some User</td> | 73 | <td tal:content="structure context/queuer/fmt:link">Some User</td> |
325 | 63 | </tr> | 74 | </tr> |
327 | 64 | <tr> | 75 | <tr id="summary-row-5-queued-revision"> |
328 | 65 | <th>Queued revision:</th> | 76 | <th>Queued revision:</th> |
329 | 66 | <td> | 77 | <td> |
330 | 67 | <tal:not-available condition="not: context/queued_revision_id"> | 78 | <tal:not-available condition="not: context/queued_revision_id"> |
331 | @@ -75,11 +86,12 @@ | |||
332 | 75 | </tr> | 86 | </tr> |
333 | 76 | </tal:queued> | 87 | </tal:queued> |
334 | 77 | <tal:merged condition="context/queue_status/enumvalue:MERGED"> | 88 | <tal:merged condition="context/queue_status/enumvalue:MERGED"> |
336 | 78 | <tr tal:condition="context/merge_reporter"> | 89 | <tr id="summary-row-6-merge-reporter" |
337 | 90 | tal:condition="context/merge_reporter"> | ||
338 | 79 | <th>Merge reported by:</th> | 91 | <th>Merge reported by:</th> |
339 | 80 | <td tal:content="structure context/merge_reporter/fmt:link">Some User</td> | 92 | <td tal:content="structure context/merge_reporter/fmt:link">Some User</td> |
340 | 81 | </tr> | 93 | </tr> |
342 | 82 | <tr> | 94 | <tr id="summary-row-7-merged-revision"> |
343 | 83 | <th>Merged at revision:</th> | 95 | <th>Merged at revision:</th> |
344 | 84 | <td> | 96 | <td> |
345 | 85 | <tal:not-available condition="not: context/merged_revno"> | 97 | <tal:not-available condition="not: context/merged_revno"> |
346 | @@ -97,19 +109,21 @@ | |||
347 | 97 | </td> | 109 | </td> |
348 | 98 | </tr> | 110 | </tr> |
349 | 99 | </tal:merged> | 111 | </tal:merged> |
351 | 100 | <tr> | 112 | <tr id="summary-row-8-source-branch"> |
352 | 101 | <th>Proposed branch:</th> | 113 | <th>Proposed branch:</th> |
353 | 102 | <td tal:content="structure context/source_branch/fmt:bzr-link">lp:~foo/bar/baz</td> | 114 | <td tal:content="structure context/source_branch/fmt:bzr-link">lp:~foo/bar/baz</td> |
354 | 103 | </tr> | 115 | </tr> |
356 | 104 | <tr> | 116 | <tr id="summary-row-9-target-branch"> |
357 | 105 | <th>Merge into:</th> | 117 | <th>Merge into:</th> |
358 | 106 | <td tal:content="structure context/target_branch/fmt:bzr-link">lp:~foo/bar/baz</td> | 118 | <td tal:content="structure context/target_branch/fmt:bzr-link">lp:~foo/bar/baz</td> |
359 | 107 | </tr> | 119 | </tr> |
361 | 108 | <tr tal:condition="context/prerequisite_branch"> | 120 | <tr id="summary-row-a-prerequisite-branch" |
362 | 121 | tal:condition="context/prerequisite_branch"> | ||
363 | 109 | <th>Prerequisite:</th> | 122 | <th>Prerequisite:</th> |
364 | 110 | <td tal:content="structure context/prerequisite_branch/fmt:bzr-link">lp:~foo/bar/baz</td> | 123 | <td tal:content="structure context/prerequisite_branch/fmt:bzr-link">lp:~foo/bar/baz</td> |
365 | 111 | </tr> | 124 | </tr> |
367 | 112 | <tr tal:condition="context/preview_diff"> | 125 | <tr id="summary-row-b-diff" |
368 | 126 | tal:condition="context/preview_diff"> | ||
369 | 113 | <th>Diff against target:</th> | 127 | <th>Diff against target:</th> |
370 | 114 | <td> | 128 | <td> |
371 | 115 | <tal:diff replace="structure context/preview_diff/fmt:link"/> | 129 | <tal:diff replace="structure context/preview_diff/fmt:link"/> |
372 | 116 | 130 | ||
373 | === modified file 'lib/lp/code/windmill/tests/test_branchmergeproposal_commitmessage.py' | |||
374 | --- lib/lp/code/windmill/tests/test_branchmergeproposal_commitmessage.py 2010-02-01 18:37:00 +0000 | |||
375 | +++ lib/lp/code/windmill/tests/test_branchmergeproposal_commitmessage.py 2010-02-26 00:40:38 +0000 | |||
376 | @@ -81,6 +81,7 @@ | |||
377 | 81 | email="mike@example.com") | 81 | email="mike@example.com") |
378 | 82 | branch = self.factory.makeBranch(owner=mike) | 82 | branch = self.factory.makeBranch(owner=mike) |
379 | 83 | second_branch = self.factory.makeBranch(product=branch.product) | 83 | second_branch = self.factory.makeBranch(product=branch.product) |
380 | 84 | self.factory.makeRevisionsForBranch(second_branch) | ||
381 | 84 | merge_proposal = second_branch.addLandingTarget(mike, branch) | 85 | merge_proposal = second_branch.addLandingTarget(mike, branch) |
382 | 85 | transaction.commit() | 86 | transaction.commit() |
383 | 86 | 87 | ||
384 | @@ -99,12 +100,16 @@ | |||
385 | 99 | xpath=u'//div[contains(@class, "yui-ichoicelist-content")]') | 100 | xpath=u'//div[contains(@class, "yui-ichoicelist-content")]') |
386 | 100 | 101 | ||
387 | 101 | # Change the status to experimental. | 102 | # Change the status to experimental. |
389 | 102 | client.click(link=u'Rejected') | 103 | client.click(link=u'Approved') |
390 | 103 | client.waits.sleep(milliseconds=SLEEP) | 104 | client.waits.sleep(milliseconds=SLEEP) |
391 | 104 | 105 | ||
392 | 105 | client.asserts.assertText( | 106 | client.asserts.assertText( |
393 | 106 | xpath=u'//td[@id="branchmergeproposal-status-value"]/span', | 107 | xpath=u'//td[@id="branchmergeproposal-status-value"]/span', |
395 | 107 | validator=u'Rejected') | 108 | validator=u'Approved') |
396 | 109 | |||
397 | 110 | client.asserts.assertText( | ||
398 | 111 | xpath=u'//tr[@id="summary-row-3-approved-revision"]/td', | ||
399 | 112 | validator=u'5') | ||
400 | 108 | 113 | ||
401 | 109 | # Reload the page and make sure the change sticks. | 114 | # Reload the page and make sure the change sticks. |
402 | 110 | client.open(url=merge_url) | 115 | client.open(url=merge_url) |
403 | @@ -114,7 +119,7 @@ | |||
404 | 114 | timeout=FOR_ELEMENT) | 119 | timeout=FOR_ELEMENT) |
405 | 115 | client.asserts.assertText( | 120 | client.asserts.assertText( |
406 | 116 | xpath=u'//td[@id="branchmergeproposal-status-value"]/span', | 121 | xpath=u'//td[@id="branchmergeproposal-status-value"]/span', |
408 | 117 | validator=u'Rejected') | 122 | validator=u'Approved') |
409 | 118 | 123 | ||
410 | 119 | 124 | ||
411 | 120 | def test_suite(): | 125 | def test_suite(): |
Need to find a good way to test this.