/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/plugins/commitfromnews/committemplate.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-01 13:47:29 UTC
  • mfrom: (7488.1.2 iter-bytes)
  • Revision ID: breezy.the.bot@gmail.com-20200601134729-6h4iywd85gpienn2
iter_files_bytes can return iterators.

Merged from https://code.launchpad.net/~jelmer/brz/iter-bytes/+merge/378776

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
            return self.message
57
57
        if found_old_path is None:
58
58
            # New file
59
 
            _, new_chunks = list(
 
59
            _, new_chunks = next(
60
60
                self.commit.builder.repository.iter_files_bytes(
61
 
                    [(found_entry.file_id, found_entry.revision, None)]))[0]
 
61
                    [(found_entry.file_id, found_entry.revision, None)]))
62
62
            content = b''.join(new_chunks).decode('utf-8')
63
63
            return self.merge_message(content)
64
64
        else:
74
74
            contents = self.commit.builder.repository.iter_files_bytes(needed)
75
75
            lines = {}
76
76
            for name, chunks in contents:
77
 
                lines[name] = osutils.chunks_to_lines(chunks)
 
77
                lines[name] = osutils.chunks_to_lines(list(chunks))
78
78
            new = lines['new']
79
79
            sequence_matcher = patiencediff.PatienceSequenceMatcher(
80
80
                None, lines['old'], new)