mod_hg.py

changeset 123
aeb0d0788869
parent 121
ac07779f788d
child 124
7b2cd8b1ba86
equal deleted inserted replaced
122:f899af683bbe 123:aeb0d0788869
30 'level': 'admin', 30 'level': 'admin',
31 }, 31 },
32 32
33 { 33 {
34 'name': 'resolves', 34 'name': 'resolves',
35 'description': 'Manually cause a ticket to be resolved by a changeset', 35 'description': '''Manually cause a ticket to be resolved by a changeset''',
36 'args': '<ticket> <changeset>', 36 'args': '<ticket> <changeset>',
37 'level': 'admin', # TODO 37 'level': 'admin', # TODO
38 },
39
40 {
41 'name': 'rebuildcommitsdb',
42 'description': '''Rebuilds commits.db''',
43 'args': None,
44 'level': 'admin',
38 }, 45 },
39 ] 46 ]
40 } 47 }
41 48
42 def plural (a): 49 def plural (a):
138 if match != None: 145 if match != None:
139 break 146 break
140 except IOError: 147 except IOError:
141 pass 148 pass
142 149
143
144 repo.hg_command ('revert', '--all') 150 repo.hg_command ('revert', '--all')
145 151
146 # Remove the email address from the author if possible 152 # Remove the email address from the author if possible
147 match = re.compile (r'^(.+) <([^>]+)>$.*').match (author) 153 match = re.compile (r'^(.+) <([^>]+)>$.*').match (author)
148 if match: 154 if match:
209 command_error (result[1]) 215 command_error (result[1])
210 else: 216 else:
211 command_error (`e`) 217 command_error (`e`)
212 218
213 def cmd_resolves (bot, args, **rest): 219 def cmd_resolves (bot, args, **rest):
214 try: 220 HgPoll.announce_ticket_resolved (args['ticket'], args['changeset'])
215 HgPoll.announce_ticket_resolved (args['ticket'], args['changeset']) 221
216 except Exception as e: 222 def cmd_rebuildcommitsdb (bot, args, **rest):
217 command_error (str (e)) 223 HgPoll.g_CommitsDb.create_new()

mercurial