Rev 6258: (mbp) Back-out BadIndexKey assertion in r6256 (Martin Pool) in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Nov 14 05:19:37 UTC 2011
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6258 [merge]
revision-id: pqm at pqm.ubuntu.com-20111114051937-k4iinxim500rk4ru
parent: pqm at pqm.ubuntu.com-20111111123826-gi1x0z0wimt8rjkb
parent: mbp at canonical.com-20111114044648-er0jwa4zecm4z775
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2011-11-14 05:19:37 +0000
message:
(mbp) Back-out BadIndexKey assertion in r6256 (Martin Pool)
modified:
bzrlib/btree_index.py index.py-20080624222253-p0x5f92uyh5hw734-7
bzrlib/tests/test_btree_index.py test_index.py-20080624222253-p0x5f92uyh5hw734-13
doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/btree_index.py'
--- a/bzrlib/btree_index.py 2011-11-07 20:31:11 +0000
+++ b/bzrlib/btree_index.py 2011-11-14 04:46:48 +0000
@@ -320,12 +320,6 @@
optimize_for_size=self._optimize_for_size)
rows[-1].writer.write(_LEAF_FLAG)
if rows[-1].writer.write(line):
- # if we failed to write, despite having an empty page to write to,
- # then line is too big. len is 2 here because we've already written
- # some header. raising the error avoids infinite recursion searching
- # for a suitably large page that will not be found.
- if rows[-1].writer.bytes_out_len <= 2:
- raise errors.BadIndexKey(string_key)
# this key did not fit in the node:
rows[-1].finish_node()
key_line = string_key + "\n"
=== modified file 'bzrlib/tests/test_btree_index.py'
--- a/bzrlib/tests/test_btree_index.py 2011-11-08 18:52:34 +0000
+++ b/bzrlib/tests/test_btree_index.py 2011-11-14 04:46:48 +0000
@@ -831,14 +831,6 @@
btree_index.BTreeGraphIndex(t1, 'index', 10) !=
btree_index.BTreeGraphIndex(t1, 'index', 20))
- def test_key_too_big(self):
- # the size that matters here is the _compressed_ size of the key, so we can't
- # do a simple character repeat.
- bigKey = ''.join(map(repr, xrange(btree_index._PAGE_SIZE)))
- self.assertRaises(errors.BadIndexKey,
- self.make_index,
- nodes=[((bigKey,), 'value', ())])
-
def test_iter_all_only_root_no_size(self):
self.make_index(nodes=[(('key',), 'value', ())])
t = transport.get_transport_from_url('trace+' + self.get_url(''))
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt 2011-11-11 01:07:15 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt 2011-11-14 04:46:48 +0000
@@ -511,9 +511,6 @@
operations that use it, like merge, can now create trees without a root.
(Aaron Bentley)
-* Raise BadIndexKey exception in btree_index when a key is too large, fixing
- an infinite recursion issue. (Shannon Weyrick, #720853)
-
Documentation
*************
More information about the bazaar-commits
mailing list