/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-13 00:24:33 UTC
  • mfrom: (7037 work)
  • mto: This revision was merged to the branch mainline in revision 7039.
  • Revision ID: jelmer@jelmer.uk-20180713002433-dr601ols49ge07fr
Merge trunk.

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 = [(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,
1018
1018
            root_ie = self._get_dir_ie(u"", None)
1019
1019
            ret = {}
1020
1020
            if specific_files is None or u"" in specific_files:
1021
 
                ret[(None, u"")] = root_ie
 
1021
                ret[(u"", u"")] = root_ie
1022
1022
            dir_ids = {u"": root_ie.file_id}
1023
1023
            for path, value in self._recurse_index_entries():
1024
1024
                if self.mapping.is_special_file(path):
1037
1037
                        ret[(posixpath.dirname(dir_path), dir_path)] = dir_ie
1038
1038
                file_ie.parent_id = self.path2id(parent)
1039
1039
                ret[(posixpath.dirname(path), path)] = file_ie
1040
 
            return ((path, ie) for ((_, path), ie) in sorted(ret.items()))
 
1040
            return ((path, ie) for ((_, path), ie) in sorted(viewitems(ret)))
1041
1041
 
1042
1042
    def iter_references(self):
1043
1043
        # TODO(jelmer): Implement a more efficient version of this