/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: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

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)