~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_py.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 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
 
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