Mercurial > hg
diff mercurial/logcmdutil.py @ 36920:6ff6e1d6b5b8
templater: move stringify() to templateutil module
As we have a util module, it doesn't make sense to import stringify() from
templatefilters.py.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 08 Mar 2018 23:10:46 +0900 |
parents | c6061cadb400 |
children | 255f635c3204 |
line wrap: on
line diff
--- a/mercurial/logcmdutil.py Wed Feb 28 15:20:41 2018 -0500 +++ b/mercurial/logcmdutil.py Thu Mar 08 23:10:46 2018 +0900 @@ -33,6 +33,7 @@ smartset, templatekw, templater, + templateutil, util, ) from .utils import dateutil @@ -449,13 +450,15 @@ self._parts.update(m) if self._parts['docheader']: - self.ui.write(templater.stringify(self.t(self._parts['docheader']))) + self.ui.write( + templateutil.stringify(self.t(self._parts['docheader']))) def close(self): if self._parts['docfooter']: if not self.footer: self.footer = "" - self.footer += templater.stringify(self.t(self._parts['docfooter'])) + self.footer += templateutil.stringify( + self.t(self._parts['docfooter'])) return super(changesettemplater, self).close() def _show(self, ctx, copies, props): @@ -470,11 +473,12 @@ # since there's inherently a conflict between header (across items) and # separator (per item) if self._parts['separator'] and index > 0: - self.ui.write(templater.stringify(self.t(self._parts['separator']))) + self.ui.write( + templateutil.stringify(self.t(self._parts['separator']))) # write header if self._parts['header']: - h = templater.stringify(self.t(self._parts['header'], **props)) + h = templateutil.stringify(self.t(self._parts['header'], **props)) if self.buffered: self.header[ctx.rev()] = h else: @@ -484,12 +488,12 @@ # write changeset metadata, then patch if requested key = self._parts[self._tref] - self.ui.write(templater.stringify(self.t(key, **props))) + self.ui.write(templateutil.stringify(self.t(key, **props))) self._showpatch(ctx) if self._parts['footer']: if not self.footer: - self.footer = templater.stringify( + self.footer = templateutil.stringify( self.t(self._parts['footer'], **props)) def templatespec(tmpl, mapfile):