Merge lp:~thumper/launchpad/branch-index-slowness into lp:launchpad
- branch-index-slowness
- Merge into devel
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Tim Penhey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11000 |
Proposed branch: | lp:~thumper/launchpad/branch-index-slowness |
Merge into: | lp:launchpad |
Diff against target: |
436 lines (+166/-26) 14 files modified
lib/lp/code/browser/branch.py (+105/-14) lib/lp/code/browser/tests/test_branch.py (+33/-1) lib/lp/code/configure.zcml (+1/-0) lib/lp/code/interfaces/branch.py (+3/-0) lib/lp/code/model/branch.py (+11/-0) lib/lp/code/templates/branch-import-details.pt (+1/-1) lib/lp/code/templates/branch-management.pt (+1/-1) lib/lp/code/templates/branch-metadata.pt (+1/-1) lib/lp/code/templates/branch-pending-merges.pt (+1/-1) lib/lp/code/templates/branch-portlet-subscribers.pt (+1/-1) lib/lp/code/templates/branch-recipes.pt (+1/-1) lib/lp/code/templates/branch-related-bugs-specs.pt (+1/-1) lib/lp/code/templates/branch-revisions.pt (+2/-2) lib/lp/testing/factory.py (+4/-2) |
To merge this branch: | bzr merge lp:~thumper/launchpad/branch-index-slowness |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Review via email: mp+27318@code.launchpad.net |
Commit message
Fix time-outs on the branch index page for branches with lots of linked bugs.
Description of the change
This branch provides a DecoratedBranch object to cache database queries. An extra method is added to the branch class to get linked bugs and all their bug tasks.
As a part of this branch, only bugs in an incomplete state are shown on series branches.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/code/browser/branch.py' | |||
2 | --- lib/lp/code/browser/branch.py 2010-05-30 04:06:48 +0000 | |||
3 | +++ lib/lp/code/browser/branch.py 2010-06-11 05:08:31 +0000 | |||
4 | @@ -25,13 +25,16 @@ | |||
5 | 25 | 'BranchURL', | 25 | 'BranchURL', |
6 | 26 | 'BranchView', | 26 | 'BranchView', |
7 | 27 | 'BranchSubscriptionsView', | 27 | 'BranchSubscriptionsView', |
8 | 28 | 'DecoratedBranch', | ||
9 | 28 | 'DecoratedBug', | 29 | 'DecoratedBug', |
10 | 29 | 'RegisterBranchMergeProposalView', | 30 | 'RegisterBranchMergeProposalView', |
11 | 30 | 'TryImportAgainView', | 31 | 'TryImportAgainView', |
12 | 31 | ] | 32 | ] |
13 | 32 | 33 | ||
14 | 33 | import cgi | 34 | import cgi |
15 | 35 | from collections import defaultdict | ||
16 | 34 | from datetime import datetime, timedelta | 36 | from datetime import datetime, timedelta |
17 | 37 | from operator import attrgetter | ||
18 | 35 | 38 | ||
19 | 36 | import pytz | 39 | import pytz |
20 | 37 | import simplejson | 40 | import simplejson |
21 | @@ -78,6 +81,7 @@ | |||
22 | 78 | from canonical.widgets.lazrjs import vocabulary_to_choice_edit_items | 81 | from canonical.widgets.lazrjs import vocabulary_to_choice_edit_items |
23 | 79 | 82 | ||
24 | 80 | from lp.bugs.interfaces.bug import IBug | 83 | from lp.bugs.interfaces.bug import IBug |
25 | 84 | from lp.bugs.interfaces.bugtask import UNRESOLVED_BUGTASK_STATUSES | ||
26 | 81 | from lp.code.browser.branchref import BranchRef | 85 | from lp.code.browser.branchref import BranchRef |
27 | 82 | from lp.code.browser.branchmergeproposal import ( | 86 | from lp.code.browser.branchmergeproposal import ( |
28 | 83 | latest_proposals_for_each_branch) | 87 | latest_proposals_for_each_branch) |
29 | @@ -90,7 +94,7 @@ | |||
30 | 90 | CodeImportAlreadyRequested, CodeImportAlreadyRunning, | 94 | CodeImportAlreadyRequested, CodeImportAlreadyRunning, |
31 | 91 | CodeImportNotInReviewedState, InvalidBranchMergeProposal) | 95 | CodeImportNotInReviewedState, InvalidBranchMergeProposal) |
32 | 92 | from lp.code.interfaces.branch import ( | 96 | from lp.code.interfaces.branch import ( |
34 | 93 | BranchCreationForbidden, BranchExists, IBranch, | 97 | BranchCreationForbidden, BranchExists, BzrIdentityMixin, IBranch, |
35 | 94 | user_has_special_branch_access) | 98 | user_has_special_branch_access) |
36 | 95 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal | 99 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposal |
37 | 96 | from lp.code.interfaces.branchtarget import IBranchTarget | 100 | from lp.code.interfaces.branchtarget import IBranchTarget |
38 | @@ -327,17 +331,103 @@ | |||
39 | 327 | 331 | ||
40 | 328 | class DecoratedBug: | 332 | class DecoratedBug: |
41 | 329 | """Provide some additional attributes to a normal bug.""" | 333 | """Provide some additional attributes to a normal bug.""" |
43 | 330 | delegates(IBug) | 334 | delegates(IBug, 'bug') |
44 | 331 | 335 | ||
47 | 332 | def __init__(self, context, branch): | 336 | def __init__(self, bug, branch, tasks=None): |
48 | 333 | self.context = context | 337 | self.bug = bug |
49 | 334 | self.branch = branch | 338 | self.branch = branch |
50 | 339 | self.tasks = tasks | ||
51 | 340 | if self.tasks is None: | ||
52 | 341 | self.tasks = self.bug.bugtasks | ||
53 | 342 | |||
54 | 343 | @property | ||
55 | 344 | def bugtasks(self): | ||
56 | 345 | return self.tasks | ||
57 | 346 | |||
58 | 347 | @property | ||
59 | 348 | def default_bugtask(self): | ||
60 | 349 | return self.tasks[0] | ||
61 | 350 | |||
62 | 351 | def getBugTask(self, target): | ||
63 | 352 | # Copied from Bug.getBugTarget to avoid importing. | ||
64 | 353 | for bugtask in self.bugtasks: | ||
65 | 354 | if bugtask.target == target: | ||
66 | 355 | return bugtask | ||
67 | 356 | return None | ||
68 | 335 | 357 | ||
69 | 336 | @property | 358 | @property |
70 | 337 | def bugtask(self): | 359 | def bugtask(self): |
71 | 338 | """Return the bugtask for the branch project, or the default bugtask. | 360 | """Return the bugtask for the branch project, or the default bugtask. |
72 | 339 | """ | 361 | """ |
74 | 340 | return self.branch.target.getBugTask(self.context) | 362 | return self.branch.target.getBugTask(self) |
75 | 363 | |||
76 | 364 | |||
77 | 365 | class DecoratedBranch(BzrIdentityMixin): | ||
78 | 366 | """Wrap a number of the branch accessors to cache results. | ||
79 | 367 | |||
80 | 368 | This avoids repeated db queries. | ||
81 | 369 | """ | ||
82 | 370 | delegates(IBranch, 'branch') | ||
83 | 371 | |||
84 | 372 | def __init__(self, branch): | ||
85 | 373 | self.branch = branch | ||
86 | 374 | |||
87 | 375 | @cachedproperty | ||
88 | 376 | def linked_bugs(self): | ||
89 | 377 | bugs = defaultdict(list) | ||
90 | 378 | for bug, task in self.branch.getLinkedBugsAndTasks(): | ||
91 | 379 | bugs[bug].append(task) | ||
92 | 380 | return [DecoratedBug(bug, self.branch, tasks) | ||
93 | 381 | for bug, tasks in bugs.iteritems()] | ||
94 | 382 | |||
95 | 383 | @property | ||
96 | 384 | def displayname(self): | ||
97 | 385 | return self.bzr_identity | ||
98 | 386 | |||
99 | 387 | @cachedproperty | ||
100 | 388 | def bzr_identity(self): | ||
101 | 389 | return super(DecoratedBranch, self).bzr_identity | ||
102 | 390 | |||
103 | 391 | @cachedproperty | ||
104 | 392 | def is_series_branch(self): | ||
105 | 393 | # True if linked to a product series or suite source package. | ||
106 | 394 | return ( | ||
107 | 395 | len(self.associated_product_series) > 0 or | ||
108 | 396 | len(self.suite_source_packages) > 0) | ||
109 | 397 | |||
110 | 398 | def associatedProductSeries(self): | ||
111 | 399 | """Override the IBranch.associatedProductSeries.""" | ||
112 | 400 | return self.associated_product_series | ||
113 | 401 | |||
114 | 402 | def associatedSuiteSourcePackages(self): | ||
115 | 403 | """Override the IBranch.associatedSuiteSourcePackages.""" | ||
116 | 404 | return self.suite_source_packages | ||
117 | 405 | |||
118 | 406 | @cachedproperty | ||
119 | 407 | def associated_product_series(self): | ||
120 | 408 | return list(self.branch.associatedProductSeries()) | ||
121 | 409 | |||
122 | 410 | @cachedproperty | ||
123 | 411 | def suite_source_packages(self): | ||
124 | 412 | return list(self.branch.associatedSuiteSourcePackages()) | ||
125 | 413 | |||
126 | 414 | @cachedproperty | ||
127 | 415 | def upgrade_pending(self): | ||
128 | 416 | return self.branch.upgrade_pending | ||
129 | 417 | |||
130 | 418 | @cachedproperty | ||
131 | 419 | def subscriptions(self): | ||
132 | 420 | return list(self.branch.subscriptions) | ||
133 | 421 | |||
134 | 422 | def hasSubscription(self, user): | ||
135 | 423 | for sub in self.subscriptions: | ||
136 | 424 | if sub.person == user: | ||
137 | 425 | return True | ||
138 | 426 | return False | ||
139 | 427 | |||
140 | 428 | @cachedproperty | ||
141 | 429 | def latest_revisions(self): | ||
142 | 430 | return list(self.branch.latest_revisions()) | ||
143 | 341 | 431 | ||
144 | 342 | 432 | ||
145 | 343 | class BranchView(LaunchpadView, FeedsMixin): | 433 | class BranchView(LaunchpadView, FeedsMixin): |
146 | @@ -356,6 +446,10 @@ | |||
147 | 356 | 446 | ||
148 | 357 | def initialize(self): | 447 | def initialize(self): |
149 | 358 | self.notices = [] | 448 | self.notices = [] |
150 | 449 | # Replace our context with a decorated branch, if it is not already | ||
151 | 450 | # decorated. | ||
152 | 451 | if not isinstance(self.context, DecoratedBranch): | ||
153 | 452 | self.context = DecoratedBranch(self.context) | ||
154 | 359 | 453 | ||
155 | 360 | def user_is_subscribed(self): | 454 | def user_is_subscribed(self): |
156 | 361 | """Is the current user subscribed to this branch?""" | 455 | """Is the current user subscribed to this branch?""" |
157 | @@ -421,13 +515,6 @@ | |||
158 | 421 | else: | 515 | else: |
159 | 422 | return None | 516 | return None |
160 | 423 | 517 | ||
161 | 424 | def edit_link_url(self): | ||
162 | 425 | """Target URL of the Edit link used in the actions portlet.""" | ||
163 | 426 | # XXX: DavidAllouche 2005-12-02 bug=5313: | ||
164 | 427 | # That should go away when bug #5313 is fixed. | ||
165 | 428 | linkdata = BranchContextMenu(self.context).edit() | ||
166 | 429 | return '%s/%s' % (canonical_url(self.context), linkdata.target) | ||
167 | 430 | |||
168 | 431 | @property | 518 | @property |
169 | 432 | def user_can_upload(self): | 519 | def user_can_upload(self): |
170 | 433 | """Whether the user can upload to this branch.""" | 520 | """Whether the user can upload to this branch.""" |
171 | @@ -517,8 +604,12 @@ | |||
172 | 517 | @cachedproperty | 604 | @cachedproperty |
173 | 518 | def linked_bugs(self): | 605 | def linked_bugs(self): |
174 | 519 | """Return a list of DecoratedBugs linked to the branch.""" | 606 | """Return a list of DecoratedBugs linked to the branch.""" |
177 | 520 | return [DecoratedBug(bug, self.context) | 607 | bugs = self.context.linked_bugs |
178 | 521 | for bug in self.context.linked_bugs] | 608 | if self.context.is_series_branch: |
179 | 609 | bugs = [ | ||
180 | 610 | bug for bug in bugs | ||
181 | 611 | if bug.bugtask.status in UNRESOLVED_BUGTASK_STATUSES] | ||
182 | 612 | return bugs | ||
183 | 522 | 613 | ||
184 | 523 | @cachedproperty | 614 | @cachedproperty |
185 | 524 | def latest_code_import_results(self): | 615 | def latest_code_import_results(self): |
186 | 525 | 616 | ||
187 | === modified file 'lib/lp/code/browser/tests/test_branch.py' | |||
188 | --- lib/lp/code/browser/tests/test_branch.py 2010-04-13 04:15:33 +0000 | |||
189 | +++ lib/lp/code/browser/tests/test_branch.py 2010-06-11 05:08:31 +0000 | |||
190 | @@ -3,6 +3,8 @@ | |||
191 | 3 | 3 | ||
192 | 4 | """Unit tests for BranchView.""" | 4 | """Unit tests for BranchView.""" |
193 | 5 | 5 | ||
194 | 6 | from __future__ import with_statement | ||
195 | 7 | |||
196 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
197 | 7 | __all__ = ['TestBranchView', 'test_suite'] | 9 | __all__ = ['TestBranchView', 'test_suite'] |
198 | 8 | 10 | ||
199 | @@ -21,6 +23,8 @@ | |||
200 | 21 | from canonical.database.constants import UTC_NOW | 23 | from canonical.database.constants import UTC_NOW |
201 | 22 | 24 | ||
202 | 23 | from lp.app.interfaces.headings import IRootContext | 25 | from lp.app.interfaces.headings import IRootContext |
203 | 26 | from lp.bugs.interfaces.bugtask import ( | ||
204 | 27 | BugTaskStatus, UNRESOLVED_BUGTASK_STATUSES) | ||
205 | 24 | from lp.code.browser.branch import ( | 28 | from lp.code.browser.branch import ( |
206 | 25 | BranchAddView, BranchMirrorStatusView, BranchReviewerEditView, | 29 | BranchAddView, BranchMirrorStatusView, BranchReviewerEditView, |
207 | 26 | BranchSparkView, BranchView) | 30 | BranchSparkView, BranchView) |
208 | @@ -32,7 +36,8 @@ | |||
209 | 32 | from lp.registry.interfaces.product import IProductSet | 36 | from lp.registry.interfaces.product import IProductSet |
210 | 33 | from lp.code.interfaces.branchlookup import IBranchLookup | 37 | from lp.code.interfaces.branchlookup import IBranchLookup |
211 | 34 | from lp.testing import ( | 38 | from lp.testing import ( |
213 | 35 | login, login_person, logout, ANONYMOUS, TestCaseWithFactory) | 39 | login, login_person, logout, person_logged_in, ANONYMOUS, |
214 | 40 | TestCaseWithFactory) | ||
215 | 36 | from lp.testing.views import create_initialized_view | 41 | from lp.testing.views import create_initialized_view |
216 | 37 | from canonical.launchpad.webapp.servers import LaunchpadTestRequest | 42 | from canonical.launchpad.webapp.servers import LaunchpadTestRequest |
217 | 38 | from canonical.testing import ( | 43 | from canonical.testing import ( |
218 | @@ -261,6 +266,33 @@ | |||
219 | 261 | login_person(branch.owner) | 266 | login_person(branch.owner) |
220 | 262 | self.assertFalse(view.user_can_upload) | 267 | self.assertFalse(view.user_can_upload) |
221 | 263 | 268 | ||
222 | 269 | def _addBugLinks(self, branch): | ||
223 | 270 | for status in BugTaskStatus.items: | ||
224 | 271 | bug = self.factory.makeBug(status=status) | ||
225 | 272 | branch.linkBug(bug, branch.owner) | ||
226 | 273 | |||
227 | 274 | def test_linked_bugs(self): | ||
228 | 275 | # The linked bugs for a non series branch shows all linked bugs. | ||
229 | 276 | branch = self.factory.makeAnyBranch() | ||
230 | 277 | with person_logged_in(branch.owner): | ||
231 | 278 | self._addBugLinks(branch) | ||
232 | 279 | view = create_initialized_view(branch, '+index') | ||
233 | 280 | self.assertEqual(len(BugTaskStatus), len(view.linked_bugs)) | ||
234 | 281 | self.assertFalse(view.context.is_series_branch) | ||
235 | 282 | |||
236 | 283 | def test_linked_bugs_series_branch(self): | ||
237 | 284 | # The linked bugs for a series branch shows only unresolved bugs. | ||
238 | 285 | product = self.factory.makeProduct() | ||
239 | 286 | branch = self.factory.makeProductBranch(product=product) | ||
240 | 287 | with person_logged_in(product.owner): | ||
241 | 288 | product.development_focus.branch = branch | ||
242 | 289 | with person_logged_in(branch.owner): | ||
243 | 290 | self._addBugLinks(branch) | ||
244 | 291 | view = create_initialized_view(branch, '+index') | ||
245 | 292 | for bug in view.linked_bugs: | ||
246 | 293 | self.assertTrue( | ||
247 | 294 | bug.bugtask.status in UNRESOLVED_BUGTASK_STATUSES) | ||
248 | 295 | |||
249 | 264 | 296 | ||
250 | 265 | class TestBranchAddView(TestCaseWithFactory): | 297 | class TestBranchAddView(TestCaseWithFactory): |
251 | 266 | """Test the BranchAddView view.""" | 298 | """Test the BranchAddView view.""" |
252 | 267 | 299 | ||
253 | === modified file 'lib/lp/code/configure.zcml' | |||
254 | --- lib/lp/code/configure.zcml 2010-05-30 04:06:48 +0000 | |||
255 | +++ lib/lp/code/configure.zcml 2010-06-11 05:08:31 +0000 | |||
256 | @@ -467,6 +467,7 @@ | |||
257 | 467 | revision_count | 467 | revision_count |
258 | 468 | bug_branches | 468 | bug_branches |
259 | 469 | linked_bugs | 469 | linked_bugs |
260 | 470 | getLinkedBugsAndTasks | ||
261 | 470 | linkBug | 471 | linkBug |
262 | 471 | unlinkBug | 472 | unlinkBug |
263 | 472 | spec_links | 473 | spec_links |
264 | 473 | 474 | ||
265 | === modified file 'lib/lp/code/interfaces/branch.py' | |||
266 | --- lib/lp/code/interfaces/branch.py 2010-05-25 03:13:25 +0000 | |||
267 | +++ lib/lp/code/interfaces/branch.py 2010-06-11 05:08:31 +0000 | |||
268 | @@ -609,6 +609,9 @@ | |||
269 | 609 | readonly=True, | 609 | readonly=True, |
270 | 610 | value_type=Reference(schema=Interface))) # Really IBug | 610 | value_type=Reference(schema=Interface))) # Really IBug |
271 | 611 | 611 | ||
272 | 612 | def getLinkedBugsAndTasks(): | ||
273 | 613 | """Return a result set for the bugs with their tasks.""" | ||
274 | 614 | |||
275 | 612 | @call_with(registrant=REQUEST_USER) | 615 | @call_with(registrant=REQUEST_USER) |
276 | 613 | @operation_parameters( | 616 | @operation_parameters( |
277 | 614 | bug=Reference(schema=Interface)) # Really IBug | 617 | bug=Reference(schema=Interface)) # Really IBug |
278 | 615 | 618 | ||
279 | === modified file 'lib/lp/code/model/branch.py' | |||
280 | --- lib/lp/code/model/branch.py 2010-05-28 09:04:16 +0000 | |||
281 | +++ lib/lp/code/model/branch.py 2010-06-11 05:08:31 +0000 | |||
282 | @@ -245,6 +245,17 @@ | |||
283 | 245 | 'Bug', joinColumn='branch', otherColumn='bug', | 245 | 'Bug', joinColumn='branch', otherColumn='bug', |
284 | 246 | intermediateTable='BugBranch', orderBy='id') | 246 | intermediateTable='BugBranch', orderBy='id') |
285 | 247 | 247 | ||
286 | 248 | def getLinkedBugsAndTasks(self): | ||
287 | 249 | """Return a result set for the bugs with their tasks.""" | ||
288 | 250 | from lp.bugs.model.bug import Bug | ||
289 | 251 | from lp.bugs.model.bugbranch import BugBranch | ||
290 | 252 | from lp.bugs.model.bugtask import BugTask | ||
291 | 253 | return Store.of(self).find( | ||
292 | 254 | (Bug, BugTask), | ||
293 | 255 | BugBranch.branch == self, | ||
294 | 256 | BugBranch.bug == Bug.id, | ||
295 | 257 | BugTask.bug == Bug.id) | ||
296 | 258 | |||
297 | 248 | def linkBug(self, bug, registrant): | 259 | def linkBug(self, bug, registrant): |
298 | 249 | """See `IBranch`.""" | 260 | """See `IBranch`.""" |
299 | 250 | return bug.linkBranch(self, registrant) | 261 | return bug.linkBranch(self, registrant) |
300 | 251 | 262 | ||
301 | === modified file 'lib/lp/code/templates/branch-import-details.pt' | |||
302 | --- lib/lp/code/templates/branch-import-details.pt 2010-01-22 03:16:44 +0000 | |||
303 | +++ lib/lp/code/templates/branch-import-details.pt 2010-06-11 05:08:31 +0000 | |||
304 | @@ -2,7 +2,7 @@ | |||
305 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
306 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
307 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
309 | 5 | tal:define="context_menu context/menu:context"> | 5 | tal:define="context_menu view/context/menu:context"> |
310 | 6 | 6 | ||
311 | 7 | <tal:imported-branch tal:condition="context/branch_type/enumvalue:IMPORTED"> | 7 | <tal:imported-branch tal:condition="context/branch_type/enumvalue:IMPORTED"> |
312 | 8 | <div id="import-details" tal:define="branch context; | 8 | <div id="import-details" tal:define="branch context; |
313 | 9 | 9 | ||
314 | === modified file 'lib/lp/code/templates/branch-management.pt' | |||
315 | --- lib/lp/code/templates/branch-management.pt 2009-09-30 12:14:24 +0000 | |||
316 | +++ lib/lp/code/templates/branch-management.pt 2010-06-11 05:08:31 +0000 | |||
317 | @@ -2,7 +2,7 @@ | |||
318 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
319 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
320 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
322 | 5 | tal:define="context_menu context/menu:context"> | 5 | tal:define="context_menu view/context/menu:context"> |
323 | 6 | 6 | ||
324 | 7 | <div tal:condition="not: context/revision_count"> | 7 | <div tal:condition="not: context/revision_count"> |
325 | 8 | <div tal:condition="context/branch_type/enumvalue:IMPORTED"> | 8 | <div tal:condition="context/branch_type/enumvalue:IMPORTED"> |
326 | 9 | 9 | ||
327 | === modified file 'lib/lp/code/templates/branch-metadata.pt' | |||
328 | --- lib/lp/code/templates/branch-metadata.pt 2010-02-17 01:37:22 +0000 | |||
329 | +++ lib/lp/code/templates/branch-metadata.pt 2010-06-11 05:08:31 +0000 | |||
330 | @@ -2,7 +2,7 @@ | |||
331 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
332 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
333 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
335 | 5 | tal:define="context_menu context/menu:context"> | 5 | tal:define="context_menu view/context/menu:context"> |
336 | 6 | 6 | ||
337 | 7 | <div class="two-column-list"> | 7 | <div class="two-column-list"> |
338 | 8 | <dl id="branch-format" tal:condition="context/branch_format"> | 8 | <dl id="branch-format" tal:condition="context/branch_format"> |
339 | 9 | 9 | ||
340 | === modified file 'lib/lp/code/templates/branch-pending-merges.pt' | |||
341 | --- lib/lp/code/templates/branch-pending-merges.pt 2010-05-22 04:19:57 +0000 | |||
342 | +++ lib/lp/code/templates/branch-pending-merges.pt 2010-06-11 05:08:31 +0000 | |||
343 | @@ -2,7 +2,7 @@ | |||
344 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
345 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
346 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
348 | 5 | tal:define="context_menu context/menu:context" | 5 | tal:define="context_menu view/context/menu:context" |
349 | 6 | tal:condition="view/show_merge_links"> | 6 | tal:condition="view/show_merge_links"> |
350 | 7 | 7 | ||
351 | 8 | <h3>Branch merges</h3> | 8 | <h3>Branch merges</h3> |
352 | 9 | 9 | ||
353 | === modified file 'lib/lp/code/templates/branch-portlet-subscribers.pt' | |||
354 | --- lib/lp/code/templates/branch-portlet-subscribers.pt 2010-01-13 00:30:26 +0000 | |||
355 | +++ lib/lp/code/templates/branch-portlet-subscribers.pt 2010-06-11 05:08:31 +0000 | |||
356 | @@ -4,7 +4,7 @@ | |||
357 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
358 | 5 | class="portlet" id="portlet-subscribers"> | 5 | class="portlet" id="portlet-subscribers"> |
359 | 6 | <div class="portletBody portletContent" | 6 | <div class="portletBody portletContent" |
361 | 7 | tal:define="context_menu context/menu:context"> | 7 | tal:define="context_menu view/context/menu:context"> |
362 | 8 | 8 | ||
363 | 9 | <div> | 9 | <div> |
364 | 10 | <div class="actions"> | 10 | <div class="actions"> |
365 | 11 | 11 | ||
366 | === modified file 'lib/lp/code/templates/branch-recipes.pt' | |||
367 | --- lib/lp/code/templates/branch-recipes.pt 2010-05-22 02:59:19 +0000 | |||
368 | +++ lib/lp/code/templates/branch-recipes.pt 2010-06-11 05:08:31 +0000 | |||
369 | @@ -2,7 +2,7 @@ | |||
370 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
371 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
372 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
374 | 5 | tal:define="context_menu context/menu:context" | 5 | tal:define="context_menu view/context/menu:context" |
375 | 6 | id="related-bugs-and-blueprints"> | 6 | id="related-bugs-and-blueprints"> |
376 | 7 | 7 | ||
377 | 8 | <h3>Related source package recipes</h3> | 8 | <h3>Related source package recipes</h3> |
378 | 9 | 9 | ||
379 | === modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt' | |||
380 | --- lib/lp/code/templates/branch-related-bugs-specs.pt 2010-05-25 04:37:27 +0000 | |||
381 | +++ lib/lp/code/templates/branch-related-bugs-specs.pt 2010-06-11 05:08:31 +0000 | |||
382 | @@ -2,7 +2,7 @@ | |||
383 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
384 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
385 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
387 | 5 | tal:define="context_menu context/menu:context"> | 5 | tal:define="context_menu view/context/menu:context"> |
388 | 6 | 6 | ||
389 | 7 | <h3>Related bugs</h3> | 7 | <h3>Related bugs</h3> |
390 | 8 | <div id="buglinks" class="actions"> | 8 | <div id="buglinks" class="actions"> |
391 | 9 | 9 | ||
392 | === modified file 'lib/lp/code/templates/branch-revisions.pt' | |||
393 | --- lib/lp/code/templates/branch-revisions.pt 2009-09-08 21:19:07 +0000 | |||
394 | +++ lib/lp/code/templates/branch-revisions.pt 2010-06-11 05:08:31 +0000 | |||
395 | @@ -2,7 +2,7 @@ | |||
396 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
397 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
398 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
400 | 5 | tal:define="context_menu context/menu:context"> | 5 | tal:define="context_menu view/context/menu:context"> |
401 | 6 | 6 | ||
402 | 7 | <p tal:condition="not:context/revision_count" | 7 | <p tal:condition="not:context/revision_count" |
403 | 8 | tal:define="branch context"> | 8 | tal:define="branch context"> |
404 | @@ -10,7 +10,7 @@ | |||
405 | 10 | </p> | 10 | </p> |
406 | 11 | 11 | ||
407 | 12 | <tal:history-available condition="context/revision_count" | 12 | <tal:history-available condition="context/revision_count" |
409 | 13 | define="branch context; | 13 | define="branch view/context; |
410 | 14 | revisions branch/latest_revisions"> | 14 | revisions branch/latest_revisions"> |
411 | 15 | <metal:landing-target use-macro="branch/@@+macros/branch-revisions"/> | 15 | <metal:landing-target use-macro="branch/@@+macros/branch-revisions"/> |
412 | 16 | 16 | ||
413 | 17 | 17 | ||
414 | === modified file 'lib/lp/testing/factory.py' | |||
415 | --- lib/lp/testing/factory.py 2010-06-10 07:09:44 +0000 | |||
416 | +++ lib/lp/testing/factory.py 2010-06-11 05:08:31 +0000 | |||
417 | @@ -1092,7 +1092,8 @@ | |||
418 | 1092 | 1092 | ||
419 | 1093 | def makeBug(self, product=None, owner=None, bug_watch_url=None, | 1093 | def makeBug(self, product=None, owner=None, bug_watch_url=None, |
420 | 1094 | private=False, date_closed=None, title=None, | 1094 | private=False, date_closed=None, title=None, |
422 | 1095 | date_created=None, description=None, comment=None): | 1095 | date_created=None, description=None, comment=None, |
423 | 1096 | status=None): | ||
424 | 1096 | """Create and return a new, arbitrary Bug. | 1097 | """Create and return a new, arbitrary Bug. |
425 | 1097 | 1098 | ||
426 | 1098 | The bug returned uses default values where possible. See | 1099 | The bug returned uses default values where possible. See |
427 | @@ -1114,7 +1115,8 @@ | |||
428 | 1114 | comment = self.getUniqueString() | 1115 | comment = self.getUniqueString() |
429 | 1115 | create_bug_params = CreateBugParams( | 1116 | create_bug_params = CreateBugParams( |
430 | 1116 | owner, title, comment=comment, private=private, | 1117 | owner, title, comment=comment, private=private, |
432 | 1117 | datecreated=date_created, description=description) | 1118 | datecreated=date_created, description=description, |
433 | 1119 | status=status) | ||
434 | 1118 | create_bug_params.setBugTarget(product=product) | 1120 | create_bug_params.setBugTarget(product=product) |
435 | 1119 | bug = getUtility(IBugSet).createBug(create_bug_params) | 1121 | bug = getUtility(IBugSet).createBug(create_bug_params) |
436 | 1120 | if bug_watch_url is not None: | 1122 | if bug_watch_url is not None: |
<rockstar> thumper, line 150 of your diff, why not use isinstance?
<thumper> rockstar: because I didn't think of it :)
<rockstar> thumper, okay. Can you remedy that?
<thumper> yep
<rockstar> thumper, do you have some data to go with this branch that might be good to go to the list?
<thumper> rockstar: what are you asking exactly
<rockstar> thumper, I think query count numbers along with the changes in this branch would be good to post to the list.
<thumper> rockstar: I'll be writing something up, yes