/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-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

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