Merge lp:~james-w/tarmac/use-web-link into lp:tarmac

Proposed by James Westby
Status: Merged
Approved by: Paul Hummer
Approved revision: 402
Merged at revision: 402
Proposed branch: lp:~james-w/tarmac/use-web-link
Merge into: lp:tarmac
Diff against target: 111 lines (+18/-22)
1 file modified
tarmac/bin/commands.py (+18/-22)
To merge this branch: bzr merge lp:~james-w/tarmac/use-web-link
Reviewer Review Type Date Requested Status
Paul Hummer Approve
Review via email: mp+145964@code.launchpad.net

Commit message

Log a message about an MP with a web link.

Description of the change

This change uses .web_link when logging a message about an MP or a branch. This
makes it quick to look at the object in question in a browser. I've found it very
useful for looking at log output in jenkins.

(from the u1 fork)

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tarmac/bin/commands.py'
2--- tarmac/bin/commands.py 2012-12-17 17:57:14 +0000
3+++ tarmac/bin/commands.py 2013-01-31 20:09:23 +0000
4@@ -171,7 +171,7 @@
5
6 self.logger.debug(
7 u'Preparing to merge %(source_branch)s' % {
8- 'source_branch': proposal.source_branch.bzr_identity})
9+ 'source_branch': proposal.source_branch.web_link})
10 source = Branch.create(
11 proposal.source_branch, self.config, target=target)
12
13@@ -186,23 +186,23 @@
14 u'No proposals of prerequisite branch.',
15 u'No proposals found for merge of %s '
16 u'into %s.' % (
17- prerequisite.display_name,
18- target.lp_branch.display_name))
19+ prerequisite.web_link,
20+ target.lp_branch.web_link))
21 elif len(merges) > 1:
22 raise TarmacMergeError(
23 u'Too many proposals of prerequisite.',
24 u'More than one proposal found for merge '
25 u'of %s into %s, which is not Superseded.' % (
26- prerequisite.display_name,
27- target.lp_branch.display_name))
28+ prerequisite.web_link,
29+ target.lp_branch.web_link))
30 elif len(merges) == 1:
31 if merges[0].queue_status != u'Merged':
32 raise TarmacMergeError(
33- u'Prerequsiite not yet merged.',
34+ u'Prerequisite not yet merged.',
35 u'The prerequisite %s has not yet been '
36 u'merged into %s.' % (
37- prerequisite.display_name,
38- target.lp_branch.display_name))
39+ prerequisite.web_link,
40+ target.lp_branch.web_link))
41
42 if not proposal.reviewed_revid:
43 raise TarmacMergeError(
44@@ -221,12 +221,10 @@
45
46 self.logger.debug(
47 'Merging %(source)s at revision %(revision)s' % {
48- 'source': proposal.source_branch.display_name,
49+ 'source': proposal.source_branch.web_link,
50 'revision': proposal.reviewed_revid})
51
52- target.merge(
53- source,
54- str(proposal.reviewed_revid))
55+ target.merge(source, str(proposal.reviewed_revid))
56
57 self.logger.debug('Firing tarmac_pre_commit hook')
58 tarmac_hooks.fire('tarmac_pre_commit',
59@@ -235,8 +233,8 @@
60 except TarmacMergeError, failure:
61 self.logger.warn(
62 u'Merging %(source)s into %(target)s failed: %(msg)s' %
63- {'source': proposal.source_branch.display_name,
64- 'target': proposal.target_branch.display_name,
65+ {'source': proposal.source_branch.web_link,
66+ 'target': proposal.target_branch.web_link,
67 'msg': str(failure)})
68
69 subject = u'Re: [Merge] %(source)s into %(target)s' % {
70@@ -248,8 +246,7 @@
71 else:
72 comment = str(failure)
73
74- proposal.createComment(subject=subject,
75- content=comment)
76+ proposal.createComment(subject=subject, content=comment)
77 try:
78 proposal.setStatus(
79 status=self.config.rejected_branch_status)
80@@ -262,8 +259,8 @@
81 self.logger.warn(
82 'Merging %(source)s into %(target)s would be '
83 'pointless.' % {
84- 'source': proposal.source_branch.display_name,
85- 'target': proposal.target_branch.display_name})
86+ 'source': proposal.source_branch.web_link,
87+ 'target': proposal.target_branch.web_link})
88 target.cleanup()
89 continue
90
91@@ -299,7 +296,7 @@
92 """Return a list of the mergable proposals for the given branch."""
93 proposals = []
94 for entry in lp_branch.landing_candidates:
95- self.logger.debug("Considering merge proposal: {0}".format(entry))
96+ self.logger.debug("Considering merge proposal: {0}".format(entry.web_link))
97
98 if entry.queue_status != u'Approved':
99 self.logger.debug(
100@@ -352,9 +349,8 @@
101 self.logger.debug('launchpad object loaded')
102
103 if branch_url:
104- self.logger.debug(
105- '%(branch_url)s specified as branch_url' % {
106- 'branch_url': branch_url})
107+ self.logger.debug('%(branch_url)s specified as branch_url' % {
108+ 'branch_url': branch_url})
109 if not branch_url.startswith('lp:'):
110 raise TarmacCommandError('Branch urls must start with lp:')
111 self._do_merges(branch_url)

Subscribers

People subscribed via source and target branches