/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/tree.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-05 23:35:09 UTC
  • mfrom: (6658 work)
  • mto: (6653.3.3 bzrwt)
  • mto: This revision was merged to the branch mainline in revision 6667.
  • Revision ID: jelmer@jelmer.uk-20170605233509-30wo916k6meuggqf
MergeĀ lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
from .decorators import needs_read_lock
44
44
from .inter import InterObject
 
45
from .sixish import (
 
46
    viewvalues,
 
47
    )
45
48
 
46
49
 
47
50
class Tree(object):
864
867
    @needs_read_lock
865
868
    def iter_child_entries(self, file_id, path=None):
866
869
        inv, inv_file_id = self._unpack_file_id(file_id)
867
 
        return inv[inv_file_id].children.itervalues()
 
870
        return iter(viewvalues(inv[inv_file_id].children))
868
871
 
869
872
    def iter_children(self, file_id, path=None):
870
873
        """See Tree.iter_children."""
871
874
        entry = self.iter_entries_by_dir([file_id]).next()[1]
872
 
        for child in getattr(entry, 'children', {}).itervalues():
 
875
        for child in viewvalues(getattr(entry, 'children', {})):
873
876
            yield child.file_id
874
877
 
875
878
 
1592
1595
        #       might ensure better ordering, in case a caller strictly
1593
1596
        #       requires parents before children.
1594
1597
        for idx, other_extra in enumerate(self._others_extra):
1595
 
            others = sorted(other_extra.itervalues(),
 
1598
            others = sorted(viewvalues(other_extra),
1596
1599
                            key=lambda x: self._path_to_key(x[0]))
1597
1600
            for other_path, other_ie in others:
1598
1601
                file_id = other_ie.file_id