23 { |
23 { |
24 'name': 'hg', |
24 'name': 'hg', |
25 'description': 'Executes a hg command', |
25 'description': 'Executes a hg command', |
26 'args': '<repo> <command...>', |
26 'args': '<repo> <command...>', |
27 'level': 'admin', |
27 'level': 'admin', |
28 } |
28 }, |
|
29 { |
|
30 'name': 'resolves', |
|
31 'description': 'Manually cause a ticket to be resolved by a changeset', |
|
32 'args': '<ticket> <changeset>', |
|
33 'level': 'admin', |
|
34 }, |
29 ] |
35 ] |
30 } |
36 } |
31 |
37 |
32 def plural (a): |
38 def plural (a): |
33 return '' if a == 1 else 's' |
39 return '' if a == 1 else 's' |
148 |
154 |
149 if result[0]: |
155 if result[0]: |
150 self.privmsg (replyto, 'error: %s' % result[1]) |
156 self.privmsg (replyto, 'error: %s' % result[1]) |
151 else: |
157 else: |
152 self.privmsg (replyto, 'error: %s' % `e`) |
158 self.privmsg (replyto, 'error: %s' % `e`) |
|
159 |
|
160 def cmd_resolves (bot, args, replyto, **rest): |
|
161 try: |
|
162 HgPoll.announce_ticket_resolved (args['ticket'], args['changeset']) |
|
163 except Exception as e: |
|
164 bot.privmsg (replyto, 'Error: %s' % e) |