~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2008-06-24 18:54:58 UTC
  • mto: (3363.8.1 stored_kind)
  • mto: This revision was merged to the branch mainline in revision 3517.
  • Revision ID: aaron@aaronbentley.com-20080624185458-3s6ejdmvb02xtg57
Fix iter_entries_by_dir ordering

Show diffs side-by-side

added added

removed removed

Lines of Context:
1398
1398
        except KeyError:
1399
1399
            return
1400
1400
        file_id = self.tree_file_id(parent_id)
1401
 
        for child in self._tree.inventory[file_id].children.iterkeys():
 
1401
        children = getattr(self._tree.inventory[file_id], 'children', {})
 
1402
        for child in children:
1402
1403
            childpath = joinpath(path, child)
1403
1404
            yield self.trans_id_tree_path(childpath)
1404
1405
 
1578
1579
        while len(todo) > 0:
1579
1580
            parent = todo.pop()
1580
1581
            parent_file_id = self._transform.final_file_id(parent)
1581
 
            children = self._all_children(parent)
 
1582
            children = list(self._all_children(parent))
 
1583
            paths = dict(zip(children, self._final_paths.get_paths(children)))
 
1584
            children.sort(key=paths.get)
1582
1585
            todo.extend(children)
1583
1586
            for trans_id in children:
1584
1587
                ordered_ids.append((trans_id, parent_file_id))
1585
1588
        for entry, trans_id in self._make_inv_entries(ordered_ids,
1586
1589
                                                      specific_file_ids):
1587
 
            yield self._final_paths.get_path(trans_id), entry
 
1590
            yield unicode(self._final_paths.get_path(trans_id)), entry
1588
1591
 
1589
1592
    def kind(self, file_id):
1590
1593
        trans_id = self._transform.trans_id_file_id(file_id)