Merge lp:~therve/twisted-trac-integration/fix-review-branches into lp:~exarkun/twisted-trac-integration/trunk

Proposed by Thomas Herve
Status: Merged
Merge reported by: Thomas Herve
Merged at revision: not available
Proposed branch: lp:~therve/twisted-trac-integration/fix-review-branches
Merge into: lp:~exarkun/twisted-trac-integration/trunk
Diff against target: 45 lines (+15/-13)
1 file modified
commit-bot/ticket.py (+15/-13)
To merge this branch: bzr merge lp:~therve/twisted-trac-integration/fix-review-branches
Reviewer Review Type Date Requested Status
Jean-Paul Calderone Approve
Review via email: mp+113975@code.launchpad.net

Description of the change

The branch changes the 2 places remaining where TICKET_RULES is used, where it's expecting a single channel but get a list instead now.

To post a comment you must log in.
Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

Sorry for not writing unit tests for this code. Change looks good (someone in the future might want to combine multi-channel announcements, so trac only gets polled for data once instead of N times, but this is fine for now).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'commit-bot/ticket.py'
2--- commit-bot/ticket.py 2012-05-25 20:16:04 +0000
3+++ commit-bot/ticket.py 2012-07-09 13:25:20 +0000
4@@ -70,13 +70,14 @@
5
6 def privmsg(self, user, channel, message):
7 if 'review branches' in message:
8- for (url, chan) in config.TICKET_RULES:
9- if chan == channel:
10- d = self.reportReviewTickets(url, chan)
11- d.addErrback(
12- log.err,
13- "Failed to satisfy review ticket request from "
14- "%r to %r" % (url, chan))
15+ for (url, channels) in config.TICKET_RULES:
16+ for existing_channel in channels:
17+ if existing_channel == channel:
18+ d = self.reportReviewTickets(url, channel)
19+ d.addErrback(
20+ log.err,
21+ "Failed to satisfy review ticket request from "
22+ "%r to %r" % (url, channel))
23
24
25 def connectionLost(self, reason):
26@@ -88,12 +89,13 @@
27 """
28 Call L{reportReviewTickets} with each element of L{config.TICKET_RULES}.
29 """
30- for (url, channel) in config.TICKET_RULES:
31- d = self.reportReviewTickets(url, channel)
32- d.addErrback(
33- log.err,
34- "Failed to report review tickets from %r to %r" % (
35- url, channel))
36+ for (url, channels) in config.TICKET_RULES:
37+ for channel in channels:
38+ d = self.reportReviewTickets(url, channel)
39+ d.addErrback(
40+ log.err,
41+ "Failed to report review tickets from %r to %r" % (
42+ url, channel))
43
44
45 def reportReviewTickets(self, trackerRoot, channel):

Subscribers

People subscribed via source and target branches