~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/index.py

Merge in bzr.dev 3801, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        self._nodes = {}
86
86
        self._nodes_by_key = None
87
87
        self._key_length = key_elements
 
88
        self._optimize_for_size = False
88
89
 
89
90
    def _check_key(self, key):
90
91
        """Raise BadIndexKey if key is not a valid key for this index."""
279
280
                (len(result.getvalue()), expected_bytes))
280
281
        return result
281
282
 
 
283
    def set_optimize(self, for_size=True):
 
284
        """Change how the builder tries to optimize the result.
 
285
 
 
286
        :param for_size: Tell the builder to try and make the index as small as
 
287
            possible.
 
288
        :return: None
 
289
        """
 
290
        # GraphIndexBuilder itself doesn't pay attention to the flag yet, but
 
291
        # other builders do.
 
292
        self._optimize_for_size = for_size
 
293
 
282
294
 
283
295
class GraphIndex(object):
284
296
    """An index for data with embedded graphs.