/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: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-05 01:55:02 UTC
  • mfrom: (6651.4.3 plugin_rewrite)
  • Revision ID: breezy.the.bot@gmail.com-20170605015502-tqiyvpz3qt00fge1
Rewrite of plugin module

Merged from https://code.launchpad.net/~gz/brz/plugin_rewrite/+merge/325033

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