~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

(gz) Fix deprecations of win32utils path function unicode wrappers (Martin
 Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# But those depend on its position within a particular inventory, and
24
24
# it would be nice not to need to hold the backpointer here.
25
25
 
 
26
from __future__ import absolute_import
 
27
 
26
28
# This should really be an id randomly assigned when the tree is
27
29
# created, but it's not for now.
28
30
ROOT_ID = "TREE_ROOT"
1490
1492
            if entry.kind == 'directory':
1491
1493
                directories_to_expand.add(entry.file_id)
1492
1494
            interesting.add(entry.parent_id)
1493
 
            children_of_parent_id.setdefault(entry.parent_id, []
1494
 
                                             ).append(entry.file_id)
 
1495
            children_of_parent_id.setdefault(entry.parent_id, set()
 
1496
                                             ).add(entry.file_id)
1495
1497
 
1496
1498
        # Now, interesting has all of the direct parents, but not the
1497
1499
        # parents of those parents. It also may have some duplicates with
1505
1507
            next_parents = set()
1506
1508
            for entry in self._getitems(remaining_parents):
1507
1509
                next_parents.add(entry.parent_id)
1508
 
                children_of_parent_id.setdefault(entry.parent_id, []
1509
 
                                                 ).append(entry.file_id)
 
1510
                children_of_parent_id.setdefault(entry.parent_id, set()
 
1511
                                                 ).add(entry.file_id)
1510
1512
            # Remove any search tips we've already processed
1511
1513
            remaining_parents = next_parents.difference(interesting)
1512
1514
            interesting.update(remaining_parents)
1525
1527
            for entry in self._getitems(next_file_ids):
1526
1528
                if entry.kind == 'directory':
1527
1529
                    directories_to_expand.add(entry.file_id)
1528
 
                children_of_parent_id.setdefault(entry.parent_id, []
1529
 
                                                 ).append(entry.file_id)
 
1530
                children_of_parent_id.setdefault(entry.parent_id, set()
 
1531
                                                 ).add(entry.file_id)
1530
1532
        return interesting, children_of_parent_id
1531
1533
 
1532
1534
    def filter(self, specific_fileids):