update bugzilla extension to use ui buffers
authorMatt Mackall <mpm@selenic.com>
Fri, 01 Dec 2006 01:29:14 -0600
changeset 3741 0897bf8d54c7
parent 3740 aef384dbc731
child 3742 86c1d1d35593
update bugzilla extension to use ui buffers
hgext/bugzilla.py
--- a/hgext/bugzilla.py	Fri Dec 01 01:29:13 2006 -0600
+++ b/hgext/bugzilla.py	Fri Dec 01 01:29:14 2006 -0600
@@ -267,20 +267,22 @@
 
         mapfile = self.ui.config('bugzilla', 'style')
         tmpl = self.ui.config('bugzilla', 'template')
-        sio = cmdutil.stringio()
-        t = cmdutil.changeset_templater(self.ui, self.repo, mapfile, sio)
+        t = cmdutil.changeset_templater(self.ui, self.repo,
+                                        False, None, mapfile, False)
         if not mapfile and not tmpl:
             tmpl = _('changeset {node|short} in repo {root} refers '
                      'to bug {bug}.\ndetails:\n\t{desc|tabindent}')
         if tmpl:
             tmpl = templater.parsestring(tmpl, quoted=False)
             t.use_template(tmpl)
+        self.ui.pushbuffer()
         t.show(changenode=node, changes=changes,
                bug=str(bugid),
                hgweb=self.ui.config('web', 'baseurl'),
                root=self.repo.root,
                webroot=webroot(self.repo.root))
-        self.add_comment(bugid, sio.getvalue(), templater.email(changes[1]))
+        data = self.ui.popbuffer()
+        self.add_comment(bugid, data, templater.email(changes[1]))
 
 def hook(ui, repo, hooktype, node=None, **kwargs):
     '''add comment to bugzilla for each changeset that refers to a