~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2013-05-19 14:29:37 UTC
  • mfrom: (6437.63.9 2.5)
  • mto: (6437.63.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6575.
  • Revision ID: john@arbash-meinel.com-20130519142937-21ykz2n2y2f22za9
Merge in the actual 2.5 branch. It seems I failed before

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
        """
299
299
        new_leaf = False
300
300
        if rows[-1].writer is None:
301
 
            new_leaf = True
302
301
            # opening a new leaf chunk;
303
302
            new_leaf = True
304
303
            for pos, internal_row in enumerate(rows[:-1]):
325
324
                optimize_for_size=self._optimize_for_size)
326
325
            rows[-1].writer.write(_LEAF_FLAG)
327
326
        if rows[-1].writer.write(line):
 
327
            # if we failed to write, despite having an empty page to write to,
 
328
            # then line is too big. raising the error avoids infinite recursion
 
329
            # searching for a suitably large page that will not be found.
328
330
            if new_leaf:
329
 
                # We just created this leaf, and now the line doesn't fit.
330
 
                # Clearly it will never fit, so punt.
331
331
                raise errors.BadIndexKey(string_key)
332
332
            # this key did not fit in the node:
333
333
            rows[-1].finish_node()