28 # version = 2.16 # version of bugzilla installed |
28 # version = 2.16 # version of bugzilla installed |
29 # |
29 # |
30 # OPTIONAL: |
30 # OPTIONAL: |
31 # bzuser = ... # bugzilla user id to record comments with |
31 # bzuser = ... # bugzilla user id to record comments with |
32 # db = bugs # database to connect to |
32 # db = bugs # database to connect to |
33 # hgweb = http:// # root of hg web site for browsing commits |
|
34 # notify = ... # command to run to get bugzilla to send mail |
33 # notify = ... # command to run to get bugzilla to send mail |
35 # regexp = ... # regexp to match bug ids (must contain one "()" group) |
34 # regexp = ... # regexp to match bug ids (must contain one "()" group) |
36 # strip = 0 # number of slashes to strip for url paths |
35 # strip = 0 # number of slashes to strip for url paths |
37 # style = ... # style file to use when formatting comments |
36 # style = ... # style file to use when formatting comments |
38 # template = ... # template to use when formatting comments |
37 # template = ... # template to use when formatting comments |
39 # timeout = 5 # database connection timeout (seconds) |
38 # timeout = 5 # database connection timeout (seconds) |
40 # user = bugs # user to connect to database as |
39 # user = bugs # user to connect to database as |
|
40 # [web] |
|
41 # baseurl = http://hgserver/... # root of hg web site for browsing commits |
41 |
42 |
42 from mercurial.demandload import * |
43 from mercurial.demandload import * |
43 from mercurial.i18n import gettext as _ |
44 from mercurial.i18n import gettext as _ |
44 from mercurial.node import * |
45 from mercurial.node import * |
45 demandload(globals(), 'cStringIO mercurial:templater,util os re time') |
46 demandload(globals(), 'cStringIO mercurial:templater,util os re time') |
264 if tmpl: |
265 if tmpl: |
265 tmpl = templater.parsestring(tmpl, quoted=False) |
266 tmpl = templater.parsestring(tmpl, quoted=False) |
266 t.use_template(tmpl) |
267 t.use_template(tmpl) |
267 t.show(changenode=node, changes=changes, |
268 t.show(changenode=node, changes=changes, |
268 bug=str(bugid), |
269 bug=str(bugid), |
269 hgweb=self.ui.config('bugzilla', 'hgweb'), |
270 hgweb=self.ui.config('web', 'baseurl'), |
270 root=self.repo.root, |
271 root=self.repo.root, |
271 webroot=webroot(self.repo.root)) |
272 webroot=webroot(self.repo.root)) |
272 self.add_comment(bugid, sio.getvalue(), templater.email(changes[1])) |
273 self.add_comment(bugid, sio.getvalue(), templater.email(changes[1])) |
273 |
274 |
274 def hook(ui, repo, hooktype, node=None, **kwargs): |
275 def hook(ui, repo, hooktype, node=None, **kwargs): |