Merge lp:~james-w/tarmac/commit-message into lp:~ubuntuone-hackers/tarmac/trunk

Proposed by James Westby
Status: Superseded
Proposed branch: lp:~james-w/tarmac/commit-message
Merge into: lp:~ubuntuone-hackers/tarmac/trunk
Diff against target: 41 lines (+25/-1)
2 files modified
tarmac/plugins/command.py (+1/-1)
tarmac/plugins/commit.py (+24/-0)
To merge this branch: bzr merge lp:~james-w/tarmac/commit-message
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+140547@code.launchpad.net

This proposal has been superseded by a proposal from 2012-12-18.

Description of the change

Hi,

This adds the commit message plugin that CA used to set the [r=<reviewer>] and [bug=] things.

It might not be needed with the template plugin used by u1.

Thanks,

James

To post a comment you must log in.
lp:~james-w/tarmac/commit-message updated
417. By James Westby

Merged utf8 into commit-message.

418. By James Westby

Merged utf8 into commit-message.

419. By James Westby

Merged utf8 into commit-message.

420. By James Westby

Merged utf8 into commit-message.

421. By James Westby

Remove the commit plugin.

422. By James Westby

Merged utf8 into commit-message.

Unmerged revisions

422. By James Westby

Merged utf8 into commit-message.

421. By James Westby

Remove the commit plugin.

420. By James Westby

Merged utf8 into commit-message.

419. By James Westby

Merged utf8 into commit-message.

418. By James Westby

Merged utf8 into commit-message.

417. By James Westby

Merged utf8 into commit-message.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tarmac/plugins/command.py'
--- tarmac/plugins/command.py 2012-03-06 19:55:15 +0000
+++ tarmac/plugins/command.py 2012-12-18 21:20:41 +0000
@@ -185,7 +185,7 @@
185 u'%(output)s') % {185 u'%(output)s') % {
186 'source': self.proposal.source_branch.display_name,186 'source': self.proposal.source_branch.display_name,
187 'target': self.proposal.target_branch.display_name,187 'target': self.proposal.target_branch.display_name,
188 'output': u'\n'.join([stdout_value, stderr_value]),188 'output': u'\n'.join([stdout_value.decode('utf-8', 'ignore'), stderr_value.decode('utf-8', 'ignore')]),
189 }189 }
190 raise VerifyCommandFailed(message, comment)190 raise VerifyCommandFailed(message, comment)
191191
192192
=== added file 'tarmac/plugins/commit.py'
--- tarmac/plugins/commit.py 1970-01-01 00:00:00 +0000
+++ tarmac/plugins/commit.py 2012-12-18 21:20:41 +0000
@@ -0,0 +1,24 @@
1import re
2
3from tarmac.hooks import tarmac_hooks
4from tarmac.plugins import TarmacPlugin
5
6
7class CommitMessage(TarmacPlugin):
8
9 def run(self, command, target, source, proposal):
10 if not re.match(r'^\[.+?\].*$', proposal.commit_message):
11 params = ["[r=%s]" % proposal.reviewer.name]
12 for bug in proposal.source_branch.linked_bugs:
13 params.append("[bug=%s]" % bug.id)
14
15 proposal.commit_message = ("%s " % ",".join(params) +
16 proposal.commit_message)
17 self.logger.debug("Setting commit_message to %s",
18 proposal.commit_message)
19 else:
20 self.logger.debug("%s has already right commit message",
21 proposal)
22
23tarmac_hooks['tarmac_pre_commit'].hook(CommitMessage(),
24 'Commit messsage template editor.')

Subscribers

People subscribed via source and target branches