/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-06-12 01:45:56 UTC
  • mfrom: (7513.1.2 pypy3)
  • Revision ID: breezy.the.bot@gmail.com-20200612014556-tsc8assk3d0luziu
Avoid deprecated behaviour in ElementTree.

Merged from https://code.launchpad.net/~jelmer/brz/pypy3/+merge/385611

Show diffs side-by-side

added added

removed removed

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