~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_py.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-26 15:59:54 UTC
  • mfrom: (4679.9.25 2.1-static-tuple-chk-map)
  • Revision ID: pqm@pqm.ubuntu.com-20091026155954-r9gw2rizkikw7cg7
(jam) Start using StaticTuple as part of the chk_map code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import zlib
20
20
import struct
21
21
 
 
22
from bzrlib.static_tuple import StaticTuple
 
23
 
22
24
_LeafNode = None
23
25
_InternalNode = None
24
26
_unknown = None
93
95
        value_lines = lines[pos:pos+num_value_lines]
94
96
        pos += num_value_lines
95
97
        value = '\n'.join(value_lines)
96
 
        items[tuple(elements[:-1])] = value
 
98
        items[StaticTuple.from_sequence(elements[:-1])] = value
97
99
    if len(items) != length:
98
100
        raise AssertionError("item count (%d) mismatch for key %s,"
99
101
            " bytes %r" % (length, key, bytes))
141
143
    for line in lines[5:]:
142
144
        line = common_prefix + line
143
145
        prefix, flat_key = line.rsplit('\x00', 1)
144
 
        items[prefix] = (flat_key,)
 
146
        items[prefix] = StaticTuple(flat_key,)
145
147
    if len(items) == 0:
146
148
        raise AssertionError("We didn't find any item for %s" % key)
147
149
    result._items = items
155
157
    result._node_width = len(prefix)
156
158
    result._search_prefix = common_prefix
157
159
    return result
158