Rev 4496: Remove the old unused code. in http://bazaar.launchpad.net/~jameinel/bzr/1.17-chk-multilevel
John Arbash Meinel
john at arbash-meinel.com
Fri Jun 26 19:49:34 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/1.17-chk-multilevel
------------------------------------------------------------
revno: 4496
revision-id: john at arbash-meinel.com-20090626184906-9ex313bwy3xmssi1
parent: john at arbash-meinel.com-20090625210443-sm9woohx9k4ebhx3
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.17-chk-multilevel
timestamp: Fri 2009-06-26 13:49:06 -0500
message:
Remove the old unused code.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py 2009-06-25 21:00:13 +0000
+++ b/bzrlib/chk_map.py 2009-06-26 18:49:06 +0000
@@ -1618,110 +1618,6 @@
heapq.heappush(self._interesting_queue,
(prefix, key, value))
-
-
-def _find_children_info(store, interesting_keys, uninteresting_keys, pb):
- """Read the associated records, and determine what is interesting."""
- uninteresting_keys = set(uninteresting_keys)
- chks_to_read = uninteresting_keys.union(interesting_keys)
- next_uninteresting = set()
- next_interesting = set()
- next_interesting_intersection = None
- uninteresting_items = set()
- interesting_items = set()
- interesting_to_yield = []
- for record in store.get_record_stream(chks_to_read, 'unordered', True):
- # records_read.add(record.key())
- if pb is not None:
- pb.tick()
- bytes = record.get_bytes_as('fulltext')
- # We don't care about search_key_func for this code, because we only
- # care about external references.
- node = _deserialise(bytes, record.key, search_key_func=None)
- if record.key in uninteresting_keys:
- if type(node) is InternalNode:
- next_uninteresting.update(node.refs())
- else:
- # We know we are at a LeafNode, so we can pass None for the
- # store
- uninteresting_items.update(node.iteritems(None))
- else:
- interesting_to_yield.append(record.key)
- if type(node) is InternalNode:
- if next_interesting_intersection is None:
- next_interesting_intersection = set(node.refs())
- else:
- next_interesting_intersection = \
- next_interesting_intersection.intersection(node.refs())
- next_interesting.update(node.refs())
- else:
- interesting_items.update(node.iteritems(None))
- return (next_uninteresting, uninteresting_items,
- next_interesting, interesting_to_yield, interesting_items,
- next_interesting_intersection)
-
-
-def _find_all_uninteresting(store, interesting_root_keys,
- uninteresting_root_keys, pb):
- """Determine the full set of uninteresting keys."""
- # What about duplicates between interesting_root_keys and
- # uninteresting_root_keys?
- if not uninteresting_root_keys:
- # Shortcut case. We know there is nothing uninteresting to filter out
- # So we just let the rest of the algorithm do the work
- # We know there is nothing uninteresting, and we didn't have to read
- # any interesting records yet.
- return (set(), set(), set(interesting_root_keys), [], set())
- all_uninteresting_chks = set(uninteresting_root_keys)
- all_uninteresting_items = set()
-
- # First step, find the direct children of both the interesting and
- # uninteresting set
- (uninteresting_keys, uninteresting_items,
- interesting_keys, interesting_to_yield,
- interesting_items, interesting_intersection,
- ) = _find_children_info(store, interesting_root_keys,
- uninteresting_root_keys,
- pb=pb)
- all_uninteresting_chks.update(uninteresting_keys)
- all_uninteresting_items.update(uninteresting_items)
- del uninteresting_items
- # Do not examine in detail pages common to all interesting trees.
- # Pages that are common to all interesting trees will have their
- # older versions found via the uninteresting tree traversal. Some pages
- # found via the interesting trees traversal will be uninteresting for
- # other of the interesting trees, which is why we require the pages to be
- # common for us to trim them.
- if interesting_intersection is not None:
- uninteresting_keys.difference_update(interesting_intersection)
-
- # Second, find the full set of uninteresting bits reachable by the
- # uninteresting roots
- chks_to_read = uninteresting_keys
- while chks_to_read:
- next_chks = set()
- for record in store.get_record_stream(chks_to_read, 'unordered', False):
- # TODO: Handle 'absent'
- if pb is not None:
- pb.tick()
- bytes = record.get_bytes_as('fulltext')
- # We don't care about search_key_func for this code, because we
- # only care about external references.
- node = _deserialise(bytes, record.key, search_key_func=None)
- if type(node) is InternalNode:
- # uninteresting_prefix_chks.update(node._items.iteritems())
- chks = node._items.values()
- # TODO: We remove the entries that are already in
- # uninteresting_chks ?
- next_chks.update(chks)
- all_uninteresting_chks.update(chks)
- else:
- all_uninteresting_items.update(node._items.iteritems())
- chks_to_read = next_chks
- return (all_uninteresting_chks, all_uninteresting_items,
- interesting_keys, interesting_to_yield, interesting_items)
-
-
def iter_interesting_nodes(store, interesting_root_keys,
uninteresting_root_keys, pb=None):
"""Given root keys, find interesting nodes.
More information about the bazaar-commits
mailing list