/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/rename_map.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:
25
25
from .i18n import gettext
26
26
from .sixish import (
27
27
    BytesIO,
 
28
    viewitems,
28
29
    )
29
30
from .ui import ui_factory
30
31
 
109
110
                task.update(gettext('Determining hash hits'), num, len(paths))
110
111
                hits = self.hitcounts(self.tree.get_file_lines(None,
111
112
                                                               path=path))
112
 
                all_hits.extend((v, path, k) for k, v in hits.items())
 
113
                all_hits.extend((v, path, k) for k, v in viewitems(hits))
113
114
        finally:
114
115
            task.finished()
115
116
        return all_hits
150
151
                    break
151
152
                required_parents.setdefault(path, []).append(child)
152
153
        require_ids = {}
153
 
        for parent, children in required_parents.iteritems():
 
154
        for parent, children in viewitems(required_parents):
154
155
            child_file_ids = set()
155
156
            for child in children:
156
157
                file_id = matches.get(child)
167
168
        parent directories.
168
169
        """
169
170
        all_hits = []
170
 
        for file_id, file_id_children in missing_parents.iteritems():
171
 
            for path, path_children in required_parents.iteritems():
 
171
        for file_id, file_id_children in viewitems(missing_parents):
 
172
            for path, path_children in viewitems(required_parents):
172
173
                hits = len(path_children.intersection(file_id_children))
173
174
                if hits > 0:
174
175
                    all_hits.append((hits, path, file_id))
250
251
 
251
252
    def _make_inventory_delta(self, matches):
252
253
        delta = []
253
 
        file_id_matches = dict((f, p) for p, f in matches.items())
254
 
        for old_path, entry in self.tree.iter_entries_by_dir(matches.values()):
 
254
        file_id_matches = dict((f, p) for p, f in viewitems(matches))
 
255
        for old_path, entry in self.tree.iter_entries_by_dir(file_id_matches):
255
256
            new_path = file_id_matches[entry.file_id]
256
257
            parent_path, new_name = osutils.split(new_path)
257
258
            parent_id = matches.get(parent_path)