/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-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
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
 
19
21
import patiencediff
20
22
 
21
23
from ... import bugtracker, osutils
56
58
            return self.message
57
59
        if found_old_path is None:
58
60
            # New file
59
 
            _, new_chunks = next(
 
61
            _, new_chunks = list(
60
62
                self.commit.builder.repository.iter_files_bytes(
61
 
                    [(found_entry.file_id, found_entry.revision, None)]))
 
63
                    [(found_entry.file_id, found_entry.revision, None)]))[0]
62
64
            content = b''.join(new_chunks).decode('utf-8')
63
65
            return self.merge_message(content)
64
66
        else:
74
76
            contents = self.commit.builder.repository.iter_files_bytes(needed)
75
77
            lines = {}
76
78
            for name, chunks in contents:
77
 
                lines[name] = osutils.chunks_to_lines(list(chunks))
 
79
                lines[name] = osutils.chunks_to_lines(chunks)
78
80
            new = lines['new']
79
81
            sequence_matcher = patiencediff.PatienceSequenceMatcher(
80
82
                None, lines['old'], new)