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
=== modified file 'lib/canonical/launchpad/webapp/batching.py'
--- lib/canonical/launchpad/webapp/batching.py 2010-08-25 19:32:37 +0000
+++ lib/canonical/launchpad/webapp/batching.py 2010-09-06 18:54:46 +0000
@@ -4,13 +4,10 @@
4__metaclass__ = type4__metaclass__ = type
55
6import lazr.batchnavigator6import lazr.batchnavigator
7from storm import Undef
8# and ISQLObjectResultSet
9from storm.zope.interfaces import IResultSet7from storm.zope.interfaces import IResultSet
10from zope.component import adapts8from zope.component import adapts
11from zope.interface import implements9from zope.interface import implements
12from zope.interface.common.sequence import IFiniteSequence10from zope.interface.common.sequence import IFiniteSequence
13from zope.security.proxy import removeSecurityProxy
1411
15from canonical.config import config12from canonical.config import config
16from canonical.launchpad.webapp.interfaces import ITableBatchNavigator13from canonical.launchpad.webapp.interfaces import ITableBatchNavigator
@@ -32,24 +29,6 @@
32 return iter(self.context)29 return iter(self.context)
3330
34 def __len__(self):31 def __len__(self):
35 # XXX 2010-08-24 leonardr bug=620508
36 #
37 # Slicing a ResultSet object returns a copy with ._limit and
38 # ._offset set appropriately. The original object's ._limit
39 # and ._offset are not affected. However, the original and
40 # the copy share a _select object, which means the original
41 # object's ._select.limit and ._select.offset are shared with
42 # the copy.
43 #
44 # This breaks Storm--count() is not supported on a ResultSet
45 # that has a limit or offset set. This code sets
46 # ._select.limit and ._select.offset to the appropriate values
47 # before running the count() query, just as __getitem__ sets
48 # those values before running its query.
49 resultset = removeSecurityProxy(self.context)
50 if hasattr(resultset, '_select'):
51 resultset._select.limit = Undef
52 resultset._select.offset = Undef
53 return self.context.count()32 return self.context.count()
5433
5534
5635
=== modified file 'versions.cfg'
--- versions.cfg 2010-09-05 10:46:30 +0000
+++ versions.cfg 2010-09-06 18:54:46 +0000
@@ -64,7 +64,10 @@
64simplesettings = 0.464simplesettings = 0.4
65SimpleTal = 4.165SimpleTal = 4.1
66sourcecodegen = 0.6.966sourcecodegen = 0.6.9
67storm = 0.1767# lp:~gary/storm/0.17-launchpad has the branch for this distribution. It is
68# 0.17 plus r374 from storm trunk for fixing lp:620508 (in order to address
69# lp:627442).
70storm = 0.17-launchpad-1
68testtools = 0.9.671testtools = 0.9.6
69transaction = 1.0.072transaction = 1.0.0
70Twisted = 10.1.073Twisted = 10.1.0