/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 bzrlib/btree_index.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-28 00:12:03 UTC
  • mfrom: (4774 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4775.
  • Revision ID: andrew.bennetts@canonical.com-20091028001203-m7lgs1wtnilgo3br
Merge lp:bzr, resolving NEWS conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
        node_refs, _ = self._check_key_ref_value(key, references, value)
164
164
        if key in self._nodes:
165
165
            raise errors.BadIndexDuplicateKey(key, self)
 
166
        # TODO: StaticTuple
166
167
        self._nodes[key] = (node_refs, value)
167
168
        self._keys.add(key)
168
169
        if self._nodes_by_key is not None and self._key_length > 1:
625
626
        for line in lines[2:]:
626
627
            if line == '':
627
628
                break
 
629
            # TODO: Switch to StaticTuple here.
628
630
            nodes.append(tuple(map(intern, line.split('\0'))))
629
631
        return nodes
630
632
 
851
853
            new_tips = next_tips
852
854
        return final_offsets
853
855
 
 
856
    def clear_cache(self):
 
857
        """Clear out any cached/memoized values.
 
858
 
 
859
        This can be called at any time, but generally it is used when we have
 
860
        extracted some information, but don't expect to be requesting any more
 
861
        from this index.
 
862
        """
 
863
        # Note that we don't touch self._root_node or self._internal_node_cache
 
864
        # We don't expect either of those to be big, and it can save
 
865
        # round-trips in the future. We may re-evaluate this if InternalNode
 
866
        # memory starts to be an issue.
 
867
        self._leaf_node_cache.clear()
 
868
 
854
869
    def external_references(self, ref_list_num):
855
870
        if self._root_node is None:
856
871
            self._get_root_node()