/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-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Logic to create commit templates."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
import patiencediff
22
20
 
23
21
from ... import bugtracker, osutils
58
56
            return self.message
59
57
        if found_old_path is None:
60
58
            # New file
61
 
            _, new_chunks = list(
 
59
            _, new_chunks = next(
62
60
                self.commit.builder.repository.iter_files_bytes(
63
 
                    [(found_entry.file_id, found_entry.revision, None)]))[0]
 
61
                    [(found_entry.file_id, found_entry.revision, None)]))
64
62
            content = b''.join(new_chunks).decode('utf-8')
65
63
            return self.merge_message(content)
66
64
        else:
76
74
            contents = self.commit.builder.repository.iter_files_bytes(needed)
77
75
            lines = {}
78
76
            for name, chunks in contents:
79
 
                lines[name] = osutils.chunks_to_lines(chunks)
 
77
                lines[name] = osutils.chunks_to_lines(list(chunks))
80
78
            new = lines['new']
81
79
            sequence_matcher = patiencediff.PatienceSequenceMatcher(
82
80
                None, lines['old'], new)