/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
 
19
from io import BytesIO
19
20
 
20
21
from . import (
21
22
    osutils,
23
24
    trace,
24
25
    )
25
26
from .i18n import gettext
26
 
from .sixish import (
27
 
    BytesIO,
28
 
    viewitems,
29
 
    viewvalues,
30
 
    )
31
27
from .ui import ui_factory
32
28
 
33
29
 
107
103
            for num, path in enumerate(paths):
108
104
                task.update(gettext('Determining hash hits'), num, len(paths))
109
105
                hits = self.hitcounts(self.tree.get_file_lines(path))
110
 
                all_hits.extend((v, path, k) for k, v in viewitems(hits))
 
106
                all_hits.extend((v, path, k) for k, v in hits.items())
111
107
        return all_hits
112
108
 
113
109
    def file_match(self, paths):
146
142
                    break
147
143
                required_parents.setdefault(path, []).append(child)
148
144
        require_ids = {}
149
 
        for parent, children in viewitems(required_parents):
 
145
        for parent, children in required_parents.items():
150
146
            child_file_ids = set()
151
147
            for child in children:
152
148
                file_id = matches.get(child)
163
159
        parent directories.
164
160
        """
165
161
        all_hits = []
166
 
        for file_id, file_id_children in viewitems(missing_parents):
167
 
            for path, path_children in viewitems(required_parents):
 
162
        for file_id, file_id_children in missing_parents.items():
 
163
            for path, path_children in required_parents.items():
168
164
                hits = len(path_children.intersection(file_id_children))
169
165
                if hits > 0:
170
166
                    all_hits.append((hits, path, file_id))
239
235
 
240
236
    def _make_inventory_delta(self, matches):
241
237
        delta = []
242
 
        file_id_matches = dict((f, p) for p, f in viewitems(matches))
 
238
        file_id_matches = dict((f, p) for p, f in matches.items())
243
239
        file_id_query = []
244
 
        for f in viewvalues(matches):
 
240
        for f in matches.values():
245
241
            try:
246
242
                file_id_query.append(self.tree.id2path(f))
247
243
            except errors.NoSuchId: