~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

(jelmer) Fix bug #1010339,
 use encoding_type='exact' for bzr testament (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
            flag when writing out. This is used by the _spill_mem_keys_to_disk
295
295
            functionality.
296
296
        """
 
297
        new_leaf = False
297
298
        if rows[-1].writer is None:
 
299
            new_leaf = True
298
300
            # opening a new leaf chunk;
299
301
            for pos, internal_row in enumerate(rows[:-1]):
300
302
                # flesh out any internal nodes that are needed to
320
322
                optimize_for_size=self._optimize_for_size)
321
323
            rows[-1].writer.write(_LEAF_FLAG)
322
324
        if rows[-1].writer.write(line):
 
325
            if new_leaf:
 
326
                # We just created this leaf, and now the line doesn't fit.
 
327
                # Clearly it will never fit, so punt.
 
328
                raise errors.BadIndexKey(line)
323
329
            # this key did not fit in the node:
324
330
            rows[-1].finish_node()
325
331
            key_line = string_key + "\n"