/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: 2018-11-16 23:19:12 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7294.
  • Revision ID: jelmer@jelmer.uk-20181116231912-e043vpq22bdkxa6q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    )
31
31
from .ui import ui_factory
32
32
 
 
33
 
33
34
class RenameMap(object):
34
35
    """Determine a mapping of renames."""
35
36
 
48
49
        """
49
50
        modulus = 1024 * 1024 * 10
50
51
        for n in range(len(lines)):
51
 
            yield hash(tuple(lines[n:n+2])) % modulus
 
52
            yield hash(tuple(lines[n:n + 2])) % modulus
52
53
 
53
54
    def add_edge_hashes(self, lines, tag):
54
55
        """Update edge_hashes to include the given lines.
68
69
        desired_files = [(tree.id2path(f), f) for f in file_ids]
69
70
        with ui_factory.nested_progress_bar() as task:
70
71
            for num, (file_id, contents) in enumerate(
71
 
                tree.iter_files_bytes(desired_files)):
 
72
                    tree.iter_files_bytes(desired_files)):
72
73
                task.update(gettext('Calculating hashes'), num, len(file_ids))
73
74
                s = BytesIO()
74
75
                s.writelines(contents)
180
181
                 kind, executable) in iterator:
181
182
                if kind[1] is None and versioned[1]:
182
183
                    if not self.tree.has_filename(self.tree.id2path(parent[0])):
183
 
                        missing_parents.setdefault(parent[0], set()).add(file_id)
 
184
                        missing_parents.setdefault(
 
185
                            parent[0], set()).add(file_id)
184
186
                    if kind[0] == 'file':
185
187
                        missing_files.add(file_id)
186
188
                    else:
187
 
                        #other kinds are not handled
 
189
                        # other kinds are not handled
188
190
                        pass
189
191
                if versioned == (False, False):
190
192
                    if self.tree.is_ignored(paths[1]):
230
232
            pp.next_phase()
231
233
            delta = rn._make_inventory_delta(matches)
232
234
            for old, new, file_id, entry in delta:
233
 
                trace.note( gettext("{0} => {1}").format(old, new) )
 
235
                trace.note(gettext("{0} => {1}").format(old, new))
234
236
            if not dry_run:
235
237
                to_tree.add(required_parents)
236
238
                to_tree.apply_inventory_delta(delta)
252
254
            if parent_id is None:
253
255
                parent_id = self.tree.path2id(parent_path)
254
256
                if parent_id is None:
255
 
                    added, ignored = self.tree.smart_add([parent_path], recurse=False)
 
257
                    added, ignored = self.tree.smart_add(
 
258
                        [parent_path], recurse=False)
256
259
                    if len(ignored) > 0 and ignored[0] == parent_path:
257
260
                        continue
258
261
                    else: