/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

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

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