Mercurial > hg > mercurial-crew-with-dirclash
diff hgext/notify.py @ 3646:b4ad640a3bcf
templates: move changeset templating bits to cmdutils
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 13 Nov 2006 13:26:57 -0600 |
parents | bf10cd8bc981 |
children | 2956948b81f3 |
line wrap: on
line diff
--- a/hgext/notify.py +++ b/hgext/notify.py @@ -68,7 +68,7 @@ from mercurial.demandload import * from mercurial.i18n import gettext as _ from mercurial.node import * -demandload(globals(), 'mercurial:commands,patch,templater,util,mail') +demandload(globals(), 'mercurial:commands,patch,cmdutil,templater,util,mail') demandload(globals(), 'email.Parser fnmatch socket time') # template for single changeset can include email headers. @@ -107,13 +107,13 @@ class notifier(object): self.stripcount = int(self.ui.config('notify', 'strip', 0)) self.root = self.strip(self.repo.root) self.domain = self.ui.config('notify', 'domain') - self.sio = templater.stringio() + self.sio = cmdutil.stringio() self.subs = self.subscribers() mapfile = self.ui.config('notify', 'style') template = (self.ui.config('notify', hooktype) or self.ui.config('notify', 'template')) - self.t = templater.changeset_templater(self.ui, self.repo, mapfile, + self.t = cmdutil.changeset_templater(self.ui, self.repo, mapfile, self.sio) if not mapfile and not template: template = deftemplates.get(hooktype) or single_template @@ -237,7 +237,7 @@ class notifier(object): maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) if maxdiff == 0: return - fp = templater.stringio() + fp = cmdutil.stringio() prev = self.repo.changelog.parents(node)[0] patch.diff(self.repo, prev, ref, fp=fp) difflines = fp.getvalue().splitlines(1)