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

  • Committer: Jelmer Vernooij
  • Date: 2018-07-08 15:47:10 UTC
  • mto: This revision was merged to the branch mainline in revision 7036.
  • Revision ID: jelmer@jelmer.uk-20180708154710-zebexq602tcer8hv
Fix more merge tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
                specific_files = None
478
478
            else:
479
479
                specific_files = set([p.encode('utf-8') for p in specific_files])
480
 
        todo = set([(self.store, "", self.tree, None)])
 
480
        todo = list([(self.store, "", self.tree, None)])
481
481
        while todo:
482
482
            store, path, tree_sha, parent_id = todo.pop()
483
483
            ie = self._get_dir_ie(path, parent_id)
491
491
                if stat.S_ISDIR(mode):
492
492
                    if (specific_files is None or
493
493
                        any(filter(lambda p: p.startswith(child_path), specific_files))):
494
 
                        todo.add((store, child_path, hexsha, ie.file_id))
 
494
                        todo.append((store, child_path, hexsha, ie.file_id))
495
495
                elif specific_files is None or child_path in specific_files:
496
496
                    yield (child_path.decode("utf-8"),
497
497
                            self._get_file_ie(store, child_path, name, mode, hexsha,
1017
1017
            root_ie = self._get_dir_ie(u"", None)
1018
1018
            ret = {}
1019
1019
            if specific_files is None or u"" in specific_files:
1020
 
                ret[(None, u"")] = root_ie
 
1020
                ret[(u"", u"")] = root_ie
1021
1021
            dir_ids = {u"": root_ie.file_id}
1022
1022
            for path, value in self._recurse_index_entries():
1023
1023
                if self.mapping.is_special_file(path):
1036
1036
                        ret[(posixpath.dirname(dir_path), dir_path)] = dir_ie
1037
1037
                file_ie.parent_id = self.path2id(parent)
1038
1038
                ret[(posixpath.dirname(path), path)] = file_ie
1039
 
            return ((path, ie) for ((_, path), ie) in sorted(ret.items()))
 
1039
            return ((path, ie) for ((_, path), ie) in sorted(viewitems(ret)))
1040
1040
 
1041
1041
    def iter_references(self):
1042
1042
        # TODO(jelmer): Implement a more efficient version of this