~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_py.py

  • Committer: Joe Julian
  • Date: 2010-01-10 02:25:31 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: joe@julianfamily.org-20100110022531-wqk61rsagz8xsiga
Added MANIFEST.in to allow bdist_rpm to have all the required include files and tools. bdist_rpm will still fail to build correctly on some distributions due to a disttools bug http://bugs.python.org/issue644744

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
16
16
 
17
17
"""Python implementation of _search_key functions, etc."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
import zlib
22
20
import struct
23
21
 
24
 
from bzrlib.static_tuple import StaticTuple
25
 
 
26
22
_LeafNode = None
27
23
_InternalNode = None
28
24
_unknown = None
97
93
        value_lines = lines[pos:pos+num_value_lines]
98
94
        pos += num_value_lines
99
95
        value = '\n'.join(value_lines)
100
 
        items[StaticTuple.from_sequence(elements[:-1])] = value
 
96
        items[tuple(elements[:-1])] = value
101
97
    if len(items) != length:
102
98
        raise AssertionError("item count (%d) mismatch for key %s,"
103
99
            " bytes %r" % (length, key, bytes))
145
141
    for line in lines[5:]:
146
142
        line = common_prefix + line
147
143
        prefix, flat_key = line.rsplit('\x00', 1)
148
 
        items[prefix] = StaticTuple(flat_key,)
 
144
        items[prefix] = (flat_key,)
149
145
    if len(items) == 0:
150
146
        raise AssertionError("We didn't find any item for %s" % key)
151
147
    result._items = items
160
156
    result._search_prefix = common_prefix
161
157
    return result
162
158
 
163
 
 
164
 
def _bytes_to_text_key(bytes):
165
 
    """Take a CHKInventory value string and return a (file_id, rev_id) tuple"""
166
 
    sections = bytes.split('\n')
167
 
    kind, file_id = sections[0].split(': ')
168
 
    return (intern(file_id), intern(sections[3]))
169