Merge lp:~gary/launchpad/bug627442 into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11515
Proposed branch: lp:~gary/launchpad/bug627442
Merge into: lp:launchpad
Diff against target: 58 lines (+4/-22)
2 files modified
lib/canonical/launchpad/webapp/batching.py (+0/-21)
versions.cfg (+4/-1)
To merge this branch: bzr merge lp:~gary/launchpad/bug627442
Reviewer Review Type Date Requested Status
Graham Binns (community) release-critical Approve
Robert Collins (community) Approve
Review via email: mp+34701@code.launchpad.net

Commit message

fix bug 620506 by cherrypicking the storm fix for bug 627442.

Description of the change

This branch fixes bug 620506 and bug 627442. These are both caused by underlying bugs in Storm. I brought the pertinent fix back to 0.17, so the new, custom storm release is 0.17 with only the cherrypick of the pertinent fix. The Storm branch includes a test, which passes, and which I am considering to be the test for this branch.

I was able to remove a previous hack around the problem because of this change. Previous tests added at that time continue to pass.

Local QA: https://api.launchpad.dev/beta/~landscape-developers/members?ws.size=1 breaks on devel, and works with this change.

Lint is happy.

This is a release-critical candidate.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

+1

Revision history for this message
Robert Collins (lifeless) wrote :

+1

review: Approve
Revision history for this message
Graham Binns (gmb) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/batching.py'
2--- lib/canonical/launchpad/webapp/batching.py 2010-08-25 19:32:37 +0000
3+++ lib/canonical/launchpad/webapp/batching.py 2010-09-06 18:54:46 +0000
4@@ -4,13 +4,10 @@
5 __metaclass__ = type
6
7 import lazr.batchnavigator
8-from storm import Undef
9-# and ISQLObjectResultSet
10 from storm.zope.interfaces import IResultSet
11 from zope.component import adapts
12 from zope.interface import implements
13 from zope.interface.common.sequence import IFiniteSequence
14-from zope.security.proxy import removeSecurityProxy
15
16 from canonical.config import config
17 from canonical.launchpad.webapp.interfaces import ITableBatchNavigator
18@@ -32,24 +29,6 @@
19 return iter(self.context)
20
21 def __len__(self):
22- # XXX 2010-08-24 leonardr bug=620508
23- #
24- # Slicing a ResultSet object returns a copy with ._limit and
25- # ._offset set appropriately. The original object's ._limit
26- # and ._offset are not affected. However, the original and
27- # the copy share a _select object, which means the original
28- # object's ._select.limit and ._select.offset are shared with
29- # the copy.
30- #
31- # This breaks Storm--count() is not supported on a ResultSet
32- # that has a limit or offset set. This code sets
33- # ._select.limit and ._select.offset to the appropriate values
34- # before running the count() query, just as __getitem__ sets
35- # those values before running its query.
36- resultset = removeSecurityProxy(self.context)
37- if hasattr(resultset, '_select'):
38- resultset._select.limit = Undef
39- resultset._select.offset = Undef
40 return self.context.count()
41
42
43
44=== modified file 'versions.cfg'
45--- versions.cfg 2010-09-05 10:46:30 +0000
46+++ versions.cfg 2010-09-06 18:54:46 +0000
47@@ -64,7 +64,10 @@
48 simplesettings = 0.4
49 SimpleTal = 4.1
50 sourcecodegen = 0.6.9
51-storm = 0.17
52+# lp:~gary/storm/0.17-launchpad has the branch for this distribution. It is
53+# 0.17 plus r374 from storm trunk for fixing lp:620508 (in order to address
54+# lp:627442).
55+storm = 0.17-launchpad-1
56 testtools = 0.9.6
57 transaction = 1.0.0
58 Twisted = 10.1.0