/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: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from ... import bugtracker, osutils, patiencediff
 
21
import patiencediff
 
22
 
 
23
from ... import bugtracker, osutils
22
24
import re
23
25
 
24
26
_BUG_MATCH = re.compile(r'lp:(\d+)')
63
65
            return self.merge_message(content)
64
66
        else:
65
67
            # Get a diff. XXX Is this hookable? I thought it was, can't find it
66
 
            # though.... add DiffTree.diff_factories. Sadly thats not at the 
 
68
            # though.... add DiffTree.diff_factories. Sadly thats not at the
67
69
            # right level: we want to identify the changed lines, not have the
68
 
            # final diff: because we want to grab the sections for regions 
 
70
            # final diff: because we want to grab the sections for regions
69
71
            # changed in new version of the file. So for now a direct diff
70
72
            # using patiencediff is done.
71
 
            old_revision = self.commit.basis_tree.get_file_revision(
72
 
                old_path, found_entry.file_id)
 
73
            old_revision = self.commit.basis_tree.get_file_revision(old_path)
73
74
            needed = [(found_entry.file_id, found_entry.revision, 'new'),
74
75
                      (found_entry.file_id, old_revision, 'old')]
75
76
            contents = self.commit.builder.repository.iter_files_bytes(needed)
96
97
                    bugids.extend(_BUG_MATCH.findall(line))
97
98
                self.commit.revprops['bugs'] = \
98
99
                    bugtracker.encode_fixes_bug_urls(
99
 
                        [bt.get_bug_url(bugid) for bugid in bugids])
 
100
                        [(bt.get_bug_url(bugid), bugtracker.FIXED)
 
101
                         for bugid in bugids])
100
102
            return self.merge_message(''.join(new_lines))
101
103
 
102
104
    def merge_message(self, new_message):