1
# Copyright (C) 2008 Canonical Ltd
1
# Copyright (C) 2008, 2009 Canonical Ltd
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
1404
1404
chks_to_read = uninteresting_keys.union(interesting_keys)
1405
1405
next_uninteresting = set()
1406
1406
next_interesting = set()
1407
next_interesting_intersection = None
1407
1408
uninteresting_items = set()
1408
1409
interesting_items = set()
1409
1410
interesting_to_yield = []
1426
1427
interesting_to_yield.append(record.key)
1427
1428
if type(node) is InternalNode:
1429
if next_interesting_intersection is None:
1430
next_interesting_intersection = set(node.refs())
1432
next_interesting_intersection = \
1433
next_interesting_intersection.intersection(node.refs())
1428
1434
next_interesting.update(node.refs())
1430
1436
interesting_items.update(node.iteritems(None))
1431
1437
return (next_uninteresting, uninteresting_items,
1432
next_interesting, interesting_to_yield, interesting_items)
1438
next_interesting, interesting_to_yield, interesting_items,
1439
next_interesting_intersection)
1435
1442
def _find_all_uninteresting(store, interesting_root_keys,
1450
1457
# uninteresting set
1451
1458
(uninteresting_keys, uninteresting_items,
1452
1459
interesting_keys, interesting_to_yield,
1453
interesting_items) = _find_children_info(store, interesting_root_keys,
1460
interesting_items, interesting_intersection,
1461
) = _find_children_info(store, interesting_root_keys,
1454
1462
uninteresting_root_keys,
1456
1464
all_uninteresting_chks.update(uninteresting_keys)
1457
1465
all_uninteresting_items.update(uninteresting_items)
1458
1466
del uninteresting_items
1459
# Note: Exact matches between interesting and uninteresting do not need
1460
# to be search further. Non-exact matches need to be searched in case
1461
# there is a future exact-match
1462
uninteresting_keys.difference_update(interesting_keys)
1467
# Do not examine in detail pages common to all interesting trees.
1468
# Pages that are common to all interesting trees will have their
1469
# older versions found via the uninteresting tree traversal. Some pages
1470
# found via the interesting trees traversal will be uninteresting for
1471
# other of the interesting trees, which is why we require the pages to be
1472
# common for us to trim them.
1473
if interesting_intersection is not None:
1474
uninteresting_keys.difference_update(interesting_intersection)
1464
1476
# Second, find the full set of uninteresting bits reachable by the
1465
1477
# uninteresting roots