/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/_chk_map_py.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 01:35:53 UTC
  • mto: (6670.4.8 move-bzr)
  • mto: This revision was merged to the branch mainline in revision 6681.
  • Revision ID: jelmer@jelmer.uk-20170610013553-560y7mn3su4pp763
Fix remaining tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Python implementation of _search_key functions, etc."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
import zlib
20
22
import struct
21
23
 
22
 
from bzrlib.static_tuple import StaticTuple
 
24
from .static_tuple import StaticTuple
23
25
 
24
26
_LeafNode = None
25
27
_InternalNode = None
63
65
    """
64
66
    global _unknown, _LeafNode, _InternalNode
65
67
    if _LeafNode is None:
66
 
        from bzrlib import chk_map
 
68
        from breezy import chk_map
67
69
        _unknown = chk_map._unknown
68
70
        _LeafNode = chk_map.LeafNode
69
71
        _InternalNode = chk_map.InternalNode
121
123
def _deserialise_internal_node(bytes, key, search_key_func=None):
122
124
    global _unknown, _LeafNode, _InternalNode
123
125
    if _InternalNode is None:
124
 
        from bzrlib import chk_map
 
126
        from breezy import chk_map
125
127
        _unknown = chk_map._unknown
126
128
        _LeafNode = chk_map.LeafNode
127
129
        _InternalNode = chk_map.InternalNode
157
159
    result._node_width = len(prefix)
158
160
    result._search_prefix = common_prefix
159
161
    return result
 
162
 
 
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