~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/index.py

(jam) Start using StaticTuple as part of the btree_index parsing code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    debug,
41
41
    errors,
42
42
    )
 
43
from bzrlib.static_tuple import StaticTuple
43
44
 
44
45
_HEADER_READV = (0, 200)
45
46
_OPTION_KEY_ELEMENTS = "key_elements="
102
103
 
103
104
    def _check_key(self, key):
104
105
        """Raise BadIndexKey if key is not a valid key for this index."""
105
 
        if type(key) != tuple:
 
106
        if type(key) not in (tuple, StaticTuple):
106
107
            raise errors.BadIndexKey(key)
107
108
        if self._key_length != len(key):
108
109
            raise errors.BadIndexKey(key)
202
203
                if reference not in self._nodes:
203
204
                    self._check_key(reference)
204
205
                    absent_references.append(reference)
 
206
            # TODO: StaticTuple
205
207
            node_refs.append(tuple(reference_list))
 
208
        # TODO: StaticTuple
206
209
        return tuple(node_refs), absent_references
207
210
 
208
211
    def add_node(self, key, value, references=()):