~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 13:38:07 UTC
  • mfrom: (6015.57.4 2.4)
  • mto: (6437.63.10 2.5)
  • mto: This revision was merged to the branch mainline in revision 6575.
  • Revision ID: john@arbash-meinel.com-20130519133807-69kfoe85gw2va4y2
Try merging 2.4 into 2.5 and resolving the conflicts.

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
301
302
            # opening a new leaf chunk;
302
303
            new_leaf = True
303
304
            for pos, internal_row in enumerate(rows[:-1]):
324
325
                optimize_for_size=self._optimize_for_size)
325
326
            rows[-1].writer.write(_LEAF_FLAG)
326
327
        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.
330
328
            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()