~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_py.py

  • Committer: Jelmer Vernooij
  • Date: 2009-04-10 15:58:09 UTC
  • mto: This revision was merged to the branch mainline in revision 4284.
  • Revision ID: jelmer@samba.org-20090410155809-kdibzcjvp7pdb83f
Fix missing import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
import zlib
20
20
import struct
21
21
 
22
 
from bzrlib.static_tuple import StaticTuple
23
 
 
24
22
_LeafNode = None
25
23
_InternalNode = None
26
24
_unknown = None
95
93
        value_lines = lines[pos:pos+num_value_lines]
96
94
        pos += num_value_lines
97
95
        value = '\n'.join(value_lines)
98
 
        items[StaticTuple.from_sequence(elements[:-1])] = value
 
96
        items[tuple(elements[:-1])] = value
99
97
    if len(items) != length:
100
98
        raise AssertionError("item count (%d) mismatch for key %s,"
101
99
            " bytes %r" % (length, key, bytes))
143
141
    for line in lines[5:]:
144
142
        line = common_prefix + line
145
143
        prefix, flat_key = line.rsplit('\x00', 1)
146
 
        items[prefix] = StaticTuple(flat_key,)
 
144
        items[prefix] = (flat_key,)
147
145
    if len(items) == 0:
148
146
        raise AssertionError("We didn't find any item for %s" % key)
149
147
    result._items = items
157
155
    result._node_width = len(prefix)
158
156
    result._search_prefix = common_prefix
159
157
    return result
 
158